Skip to content

Commit

Permalink
[WIP] Add FileSystem module for fs/file-system-access APIs (#47)
Browse files Browse the repository at this point in the history
* Add FileSystem module for fs/file-system-access APIs

* Revert "Revert "Update to latest IDL specs""

This reverts commit 6e85c64.

* + Permissions

* + SharedArrayBuffer

* Mark WritableStream as `open`

* Disable createSyncAccessHandle API

* Fix demo build error

* Swap to separate properties

* + inlinable

* + `storage` spec to FileSystem module

* Fix test

* Fix WebGLDemo

* Define cross-module extensions

* Exclude WorkerNavigator extensions

* Fix SVG/mathml errors

* stable sorting of extensions

* Remove data.json

* Update generated

---------

Co-authored-by: STREGA <[email protected]>
  • Loading branch information
j-f1 and STREGA authored Jul 19, 2023
1 parent 6e85c64 commit bc437f1
Show file tree
Hide file tree
Showing 19 changed files with 2,024 additions and 277,263 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ xcuserdata/
node_modules
.vscode
.swiftpm
data.json
10 changes: 9 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ let package = Package(
name: "SVG",
targets: ["SVG"]
),
.library(
name: "FileSystem",
targets: ["FileSystem"]
),
.executable(name: "WebIDLToSwift", targets: ["WebIDLToSwift"]),
],
dependencies: [
Expand Down Expand Up @@ -106,12 +110,16 @@ let package = Package(
),
.target(
name: "CSSOM",
dependencies: ["DOM", "WebAPIBase", "ECMAScript"]
dependencies: ["DOM", "WebAPIBase", "SVG", "ECMAScript"]
),
.target(
name: "SVG",
dependencies: ["DOM", "WebAPIBase", "ECMAScript"]
),
.target(
name: "FileSystem",
dependencies: ["DOM", "WebAPIBase", "ECMAScript"]
),
// This support library should be moved to JavaScriptKit
.target(name: "ECMAScript", dependencies: [
"JavaScriptKit",
Expand Down
9 changes: 9 additions & 0 deletions Sources/CSSOM/Generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import DOM
import ECMAScript
import JavaScriptEventLoop
import JavaScriptKit
import SVG
import WebAPIBase

public class BoxQuadOptions: BridgedDictionary {
Expand Down Expand Up @@ -1665,6 +1666,10 @@ public extension ElementCSSInlineStyle {
@inlinable var attributeStyleMap: StylePropertyMap { jsObject[Strings.attributeStyleMap].fromJSValue()! }
}

extension MathMLElement: ElementCSSInlineStyle {}

extension SVGElement: ElementCSSInlineStyle {}

public protocol GeometryUtils: JSBridgedClass {}
public extension GeometryUtils {
@inlinable func getBoxQuads(options: BoxQuadOptions? = nil) -> [DOMQuad] {
Expand All @@ -1688,6 +1693,10 @@ public extension GeometryUtils {
}
}

extension CSSPseudoElement: GeometryUtils {}

extension Text: GeometryUtils {}

public protocol LinkStyle: JSBridgedClass {}
public extension LinkStyle {
@inlinable var sheet: CSSStyleSheet? { jsObject[Strings.sheet].fromJSValue() }
Expand Down
Loading

0 comments on commit bc437f1

Please sign in to comment.