forked from swiftwasm/JavaScriptKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStaticProperties.Global.swift
More file actions
341 lines (310 loc) · 11.9 KB
/
Copy pathStaticProperties.Global.swift
File metadata and controls
341 lines (310 loc) · 11.9 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
extension PropertyEnum: _BridgedSwiftCaseEnum {
@_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> Int32 {
return bridgeJSRawValue
}
@_spi(BridgeJS) @_transparent public static func bridgeJSLiftReturn(_ value: Int32) -> PropertyEnum {
return bridgeJSLiftParameter(value)
}
@_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter(_ value: Int32) -> PropertyEnum {
return PropertyEnum(bridgeJSRawValue: value)!
}
@_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() -> Int32 {
return bridgeJSLowerParameter()
}
@_spi(BridgeJS) @usableFromInline init?(bridgeJSRawValue: Int32) {
switch bridgeJSRawValue {
case 0:
self = .value1
case 1:
self = .value2
default:
return nil
}
}
@_spi(BridgeJS) @usableFromInline var bridgeJSRawValue: Int32 {
switch self {
case .value1:
return 0
case .value2:
return 1
}
}
}
@_expose(wasm, "bjs_PropertyEnum_static_enumProperty_get")
@_cdecl("bjs_PropertyEnum_static_enumProperty_get")
public func _bjs_PropertyEnum_static_enumProperty_get() -> Void {
#if arch(wasm32)
let ret = PropertyEnum.enumProperty
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyEnum_static_enumProperty_set")
@_cdecl("bjs_PropertyEnum_static_enumProperty_set")
public func _bjs_PropertyEnum_static_enumProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void {
#if arch(wasm32)
PropertyEnum.enumProperty = String.bridgeJSLiftParameter(valueBytes, valueLength)
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyEnum_static_enumConstant_get")
@_cdecl("bjs_PropertyEnum_static_enumConstant_get")
public func _bjs_PropertyEnum_static_enumConstant_get() -> Int32 {
#if arch(wasm32)
let ret = PropertyEnum.enumConstant
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyEnum_static_computedEnum_get")
@_cdecl("bjs_PropertyEnum_static_computedEnum_get")
public func _bjs_PropertyEnum_static_computedEnum_get() -> Void {
#if arch(wasm32)
let ret = PropertyEnum.computedEnum
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyEnum_static_computedEnum_set")
@_cdecl("bjs_PropertyEnum_static_computedEnum_set")
public func _bjs_PropertyEnum_static_computedEnum_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void {
#if arch(wasm32)
PropertyEnum.computedEnum = String.bridgeJSLiftParameter(valueBytes, valueLength)
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyNamespace_static_namespaceProperty_get")
@_cdecl("bjs_PropertyNamespace_static_namespaceProperty_get")
public func _bjs_PropertyNamespace_static_namespaceProperty_get() -> Void {
#if arch(wasm32)
let ret = PropertyNamespace.namespaceProperty
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyNamespace_static_namespaceProperty_set")
@_cdecl("bjs_PropertyNamespace_static_namespaceProperty_set")
public func _bjs_PropertyNamespace_static_namespaceProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void {
#if arch(wasm32)
PropertyNamespace.namespaceProperty = String.bridgeJSLiftParameter(valueBytes, valueLength)
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyNamespace_static_namespaceConstant_get")
@_cdecl("bjs_PropertyNamespace_static_namespaceConstant_get")
public func _bjs_PropertyNamespace_static_namespaceConstant_get() -> Void {
#if arch(wasm32)
let ret = PropertyNamespace.namespaceConstant
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyNamespace_Nested_static_nestedProperty_get")
@_cdecl("bjs_PropertyNamespace_Nested_static_nestedProperty_get")
public func _bjs_PropertyNamespace_Nested_static_nestedProperty_get() -> Int32 {
#if arch(wasm32)
let ret = PropertyNamespace.Nested.nestedProperty
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyNamespace_Nested_static_nestedProperty_set")
@_cdecl("bjs_PropertyNamespace_Nested_static_nestedProperty_set")
public func _bjs_PropertyNamespace_Nested_static_nestedProperty_set(_ value: Int32) -> Void {
#if arch(wasm32)
PropertyNamespace.Nested.nestedProperty = Int.bridgeJSLiftParameter(value)
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyNamespace_Nested_static_nestedConstant_get")
@_cdecl("bjs_PropertyNamespace_Nested_static_nestedConstant_get")
public func _bjs_PropertyNamespace_Nested_static_nestedConstant_get() -> Void {
#if arch(wasm32)
let ret = PropertyNamespace.Nested.nestedConstant
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyNamespace_Nested_static_nestedDouble_get")
@_cdecl("bjs_PropertyNamespace_Nested_static_nestedDouble_get")
public func _bjs_PropertyNamespace_Nested_static_nestedDouble_get() -> Float64 {
#if arch(wasm32)
let ret = PropertyNamespace.Nested.nestedDouble
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyNamespace_Nested_static_nestedDouble_set")
@_cdecl("bjs_PropertyNamespace_Nested_static_nestedDouble_set")
public func _bjs_PropertyNamespace_Nested_static_nestedDouble_set(_ value: Float64) -> Void {
#if arch(wasm32)
PropertyNamespace.Nested.nestedDouble = Double.bridgeJSLiftParameter(value)
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_init")
@_cdecl("bjs_PropertyClass_init")
public func _bjs_PropertyClass_init() -> UnsafeMutableRawPointer {
#if arch(wasm32)
let ret = PropertyClass()
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_static_staticConstant_get")
@_cdecl("bjs_PropertyClass_static_staticConstant_get")
public func _bjs_PropertyClass_static_staticConstant_get() -> Void {
#if arch(wasm32)
let ret = PropertyClass.staticConstant
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_static_staticVariable_get")
@_cdecl("bjs_PropertyClass_static_staticVariable_get")
public func _bjs_PropertyClass_static_staticVariable_get() -> Int32 {
#if arch(wasm32)
let ret = PropertyClass.staticVariable
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_static_staticVariable_set")
@_cdecl("bjs_PropertyClass_static_staticVariable_set")
public func _bjs_PropertyClass_static_staticVariable_set(_ value: Int32) -> Void {
#if arch(wasm32)
PropertyClass.staticVariable = Int.bridgeJSLiftParameter(value)
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_static_jsObjectProperty_get")
@_cdecl("bjs_PropertyClass_static_jsObjectProperty_get")
public func _bjs_PropertyClass_static_jsObjectProperty_get() -> Int32 {
#if arch(wasm32)
let ret = PropertyClass.jsObjectProperty
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_static_jsObjectProperty_set")
@_cdecl("bjs_PropertyClass_static_jsObjectProperty_set")
public func _bjs_PropertyClass_static_jsObjectProperty_set(_ value: Int32) -> Void {
#if arch(wasm32)
PropertyClass.jsObjectProperty = JSObject.bridgeJSLiftParameter(value)
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_static_classVariable_get")
@_cdecl("bjs_PropertyClass_static_classVariable_get")
public func _bjs_PropertyClass_static_classVariable_get() -> Void {
#if arch(wasm32)
let ret = PropertyClass.classVariable
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_static_classVariable_set")
@_cdecl("bjs_PropertyClass_static_classVariable_set")
public func _bjs_PropertyClass_static_classVariable_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void {
#if arch(wasm32)
PropertyClass.classVariable = String.bridgeJSLiftParameter(valueBytes, valueLength)
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_static_computedProperty_get")
@_cdecl("bjs_PropertyClass_static_computedProperty_get")
public func _bjs_PropertyClass_static_computedProperty_get() -> Void {
#if arch(wasm32)
let ret = PropertyClass.computedProperty
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_static_computedProperty_set")
@_cdecl("bjs_PropertyClass_static_computedProperty_set")
public func _bjs_PropertyClass_static_computedProperty_set(_ valueBytes: Int32, _ valueLength: Int32) -> Void {
#if arch(wasm32)
PropertyClass.computedProperty = String.bridgeJSLiftParameter(valueBytes, valueLength)
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_static_readOnlyComputed_get")
@_cdecl("bjs_PropertyClass_static_readOnlyComputed_get")
public func _bjs_PropertyClass_static_readOnlyComputed_get() -> Int32 {
#if arch(wasm32)
let ret = PropertyClass.readOnlyComputed
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_static_optionalProperty_get")
@_cdecl("bjs_PropertyClass_static_optionalProperty_get")
public func _bjs_PropertyClass_static_optionalProperty_get() -> Void {
#if arch(wasm32)
let ret = PropertyClass.optionalProperty
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_static_optionalProperty_set")
@_cdecl("bjs_PropertyClass_static_optionalProperty_set")
public func _bjs_PropertyClass_static_optionalProperty_set(_ valueIsSome: Int32, _ valueBytes: Int32, _ valueLength: Int32) -> Void {
#if arch(wasm32)
PropertyClass.optionalProperty = Optional<String>.bridgeJSLiftParameter(valueIsSome, valueBytes, valueLength)
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_PropertyClass_deinit")
@_cdecl("bjs_PropertyClass_deinit")
public func _bjs_PropertyClass_deinit(_ pointer: UnsafeMutableRawPointer) -> Void {
#if arch(wasm32)
Unmanaged<PropertyClass>.fromOpaque(pointer).release()
#else
fatalError("Only available on WebAssembly")
#endif
}
extension PropertyClass: ConvertibleToJSValue, _BridgedSwiftHeapObject, _BridgedSwiftProtocolExportable {
var jsValue: JSValue {
return .object(JSObject(id: UInt32(bitPattern: _bjs_PropertyClass_wrap(Unmanaged.passRetained(self).toOpaque()))))
}
consuming func bridgeJSLowerAsProtocolReturn() -> Int32 {
_bjs_PropertyClass_wrap(Unmanaged.passRetained(self).toOpaque())
}
}
#if arch(wasm32)
@_extern(wasm, module: "TestModule", name: "bjs_PropertyClass_wrap")
fileprivate func _bjs_PropertyClass_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32
#else
fileprivate func _bjs_PropertyClass_wrap_extern(_ pointer: UnsafeMutableRawPointer) -> Int32 {
fatalError("Only available on WebAssembly")
}
#endif
@inline(never) fileprivate func _bjs_PropertyClass_wrap(_ pointer: UnsafeMutableRawPointer) -> Int32 {
return _bjs_PropertyClass_wrap_extern(pointer)
}