-
-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathBridgeJS.Macros.swift
More file actions
65 lines (47 loc) · 2.46 KB
/
BridgeJS.Macros.swift
File metadata and controls
65 lines (47 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// NOTICE: This is auto-generated code by BridgeJS from JavaScriptKit,
// DO NOT EDIT.
//
// To update this file, just rebuild your project or run
// `swift package bridge-js`.
@_spi(Experimental) @_spi(BridgeJS) import JavaScriptKit
@JSFunction func jsRoundTripVoid() throws(JSException) -> Void
@JSFunction func jsRoundTripNumber(_ v: Double) throws(JSException) -> Double
@JSFunction func jsRoundTripBool(_ v: Bool) throws(JSException) -> Bool
@JSFunction func jsRoundTripString(_ v: String) throws(JSException) -> String
@JSFunction func jsThrowOrVoid(_ shouldThrow: Bool) throws(JSException) -> Void
@JSFunction func jsThrowOrNumber(_ shouldThrow: Bool) throws(JSException) -> Double
@JSFunction func jsThrowOrBool(_ shouldThrow: Bool) throws(JSException) -> Bool
@JSFunction func jsThrowOrString(_ shouldThrow: Bool) throws(JSException) -> String
enum FeatureFlag: String {
case foo = "foo"
case bar = "bar"
}
extension FeatureFlag: _BridgedSwiftEnumNoPayload, _BridgedSwiftRawValueEnum {}
@JSFunction func jsRoundTripFeatureFlag(_ flag: FeatureFlag) throws(JSException) -> FeatureFlag
@JSClass struct JsGreeter {
@JSGetter var name: String
@JSSetter func setName(_ value: String) throws(JSException)
@JSGetter var `prefix`: String
@JSFunction init(_ name: String, _ `prefix`: String) throws(JSException)
@JSFunction func greet() throws(JSException) -> String
@JSFunction func changeName(_ name: String) throws(JSException) -> Void
}
@JSFunction func runAsyncWorks() throws(JSException) -> JSPromise
@JSFunction(jsName: "$jsWeirdFunction") func _jsWeirdFunction() throws(JSException) -> Double
@JSClass(jsName: "$WeirdClass") struct _WeirdClass {
@JSFunction init() throws(JSException)
@JSFunction(jsName: "method-with-dashes") func method_with_dashes() throws(JSException) -> String
}
@JSFunction(from: .global) func parseInt(_ string: String) throws(JSException) -> Double
@JSClass(from: .global) struct Animal {
@JSGetter var name: String
@JSSetter func setName(_ value: String) throws(JSException)
@JSGetter var age: Double
@JSSetter func setAge(_ value: Double) throws(JSException)
@JSGetter var isCat: Bool
@JSSetter func setIsCat(_ value: Bool) throws(JSException)
@JSFunction init(_ name: String, _ age: Double, _ isCat: Bool) throws(JSException)
@JSFunction func bark() throws(JSException) -> String
@JSFunction func getIsCat() throws(JSException) -> Bool
}
@JSGetter(from: .global) var globalObject1: JSObject