77
88@_spi ( BridgeJS) import JavaScriptKit
99
10+ extension PlayBridgeJSOutput : _BridgedSwiftStruct {
11+ @_spi ( BridgeJS) @_transparent public static func bridgeJSStackPop( ) -> PlayBridgeJSOutput {
12+ let swiftGlue = String . bridgeJSStackPop ( )
13+ let importSwiftMacroDecls = String . bridgeJSStackPop ( )
14+ let outputDts = String . bridgeJSStackPop ( )
15+ let outputJs = String . bridgeJSStackPop ( )
16+ return PlayBridgeJSOutput ( outputJs: outputJs, outputDts: outputDts, importSwiftMacroDecls: importSwiftMacroDecls, swiftGlue: swiftGlue)
17+ }
18+
19+ @_spi ( BridgeJS) @_transparent public consuming func bridgeJSStackPush( ) {
20+ self . outputJs. bridgeJSStackPush ( )
21+ self . outputDts. bridgeJSStackPush ( )
22+ self . importSwiftMacroDecls. bridgeJSStackPush ( )
23+ self . swiftGlue. bridgeJSStackPush ( )
24+ }
25+
26+ init ( unsafelyCopying jsObject: JSObject ) {
27+ let __bjs_cleanupId = _bjs_struct_lower_PlayBridgeJSOutput ( jsObject. bridgeJSLowerParameter ( ) )
28+ defer {
29+ _swift_js_struct_cleanup ( __bjs_cleanupId)
30+ }
31+ self = Self . bridgeJSStackPop ( )
32+ }
33+
34+ func toJSObject( ) -> JSObject {
35+ let __bjs_self = self
36+ __bjs_self. bridgeJSStackPush ( )
37+ return JSObject ( id: UInt32 ( bitPattern: _bjs_struct_lift_PlayBridgeJSOutput ( ) ) )
38+ }
39+ }
40+
41+ #if arch(wasm32)
42+ @_extern ( wasm, module: " bjs " , name: " swift_js_struct_lower_PlayBridgeJSOutput " )
43+ fileprivate func _bjs_struct_lower_PlayBridgeJSOutput( _ objectId: Int32 ) -> Int32
44+ #else
45+ fileprivate func _bjs_struct_lower_PlayBridgeJSOutput( _ objectId: Int32 ) -> Int32 {
46+ fatalError ( " Only available on WebAssembly " )
47+ }
48+ #endif
49+
50+ #if arch(wasm32)
51+ @_extern ( wasm, module: " bjs " , name: " swift_js_struct_lift_PlayBridgeJSOutput " )
52+ fileprivate func _bjs_struct_lift_PlayBridgeJSOutput( ) -> Int32
53+ #else
54+ fileprivate func _bjs_struct_lift_PlayBridgeJSOutput( ) -> Int32 {
55+ fatalError ( " Only available on WebAssembly " )
56+ }
57+ #endif
58+
59+ extension PlayBridgeJSDiagnostic : _BridgedSwiftStruct {
60+ @_spi ( BridgeJS) @_transparent public static func bridgeJSStackPop( ) -> PlayBridgeJSDiagnostic {
61+ let endColumn = Int . bridgeJSStackPop ( )
62+ let endLine = Int . bridgeJSStackPop ( )
63+ let startColumn = Int . bridgeJSStackPop ( )
64+ let startLine = Int . bridgeJSStackPop ( )
65+ let message = String . bridgeJSStackPop ( )
66+ let file = String . bridgeJSStackPop ( )
67+ return PlayBridgeJSDiagnostic ( file: file, message: message, startLine: startLine, startColumn: startColumn, endLine: endLine, endColumn: endColumn)
68+ }
69+
70+ @_spi ( BridgeJS) @_transparent public consuming func bridgeJSStackPush( ) {
71+ self . file. bridgeJSStackPush ( )
72+ self . message. bridgeJSStackPush ( )
73+ self . startLine. bridgeJSStackPush ( )
74+ self . startColumn. bridgeJSStackPush ( )
75+ self . endLine. bridgeJSStackPush ( )
76+ self . endColumn. bridgeJSStackPush ( )
77+ }
78+
79+ init ( unsafelyCopying jsObject: JSObject ) {
80+ let __bjs_cleanupId = _bjs_struct_lower_PlayBridgeJSDiagnostic ( jsObject. bridgeJSLowerParameter ( ) )
81+ defer {
82+ _swift_js_struct_cleanup ( __bjs_cleanupId)
83+ }
84+ self = Self . bridgeJSStackPop ( )
85+ }
86+
87+ func toJSObject( ) -> JSObject {
88+ let __bjs_self = self
89+ __bjs_self. bridgeJSStackPush ( )
90+ return JSObject ( id: UInt32 ( bitPattern: _bjs_struct_lift_PlayBridgeJSDiagnostic ( ) ) )
91+ }
92+ }
93+
94+ #if arch(wasm32)
95+ @_extern ( wasm, module: " bjs " , name: " swift_js_struct_lower_PlayBridgeJSDiagnostic " )
96+ fileprivate func _bjs_struct_lower_PlayBridgeJSDiagnostic( _ objectId: Int32 ) -> Int32
97+ #else
98+ fileprivate func _bjs_struct_lower_PlayBridgeJSDiagnostic( _ objectId: Int32 ) -> Int32 {
99+ fatalError ( " Only available on WebAssembly " )
100+ }
101+ #endif
102+
103+ #if arch(wasm32)
104+ @_extern ( wasm, module: " bjs " , name: " swift_js_struct_lift_PlayBridgeJSDiagnostic " )
105+ fileprivate func _bjs_struct_lift_PlayBridgeJSDiagnostic( ) -> Int32
106+ #else
107+ fileprivate func _bjs_struct_lift_PlayBridgeJSDiagnostic( ) -> Int32 {
108+ fatalError ( " Only available on WebAssembly " )
109+ }
110+ #endif
111+
112+ extension PlayBridgeJSResult : _BridgedSwiftStruct {
113+ @_spi ( BridgeJS) @_transparent public static func bridgeJSStackPop( ) -> PlayBridgeJSResult {
114+ let diagnostics = [ PlayBridgeJSDiagnostic ] . bridgeJSStackPop ( )
115+ let output = Optional< PlayBridgeJSOutput> . bridgeJSStackPop( )
116+ return PlayBridgeJSResult ( output: output, diagnostics: diagnostics)
117+ }
118+
119+ @_spi ( BridgeJS) @_transparent public consuming func bridgeJSStackPush( ) {
120+ self . output. bridgeJSStackPush ( )
121+ self . diagnostics. bridgeJSStackPush ( )
122+ }
123+
124+ init ( unsafelyCopying jsObject: JSObject ) {
125+ let __bjs_cleanupId = _bjs_struct_lower_PlayBridgeJSResult ( jsObject. bridgeJSLowerParameter ( ) )
126+ defer {
127+ _swift_js_struct_cleanup ( __bjs_cleanupId)
128+ }
129+ self = Self . bridgeJSStackPop ( )
130+ }
131+
132+ func toJSObject( ) -> JSObject {
133+ let __bjs_self = self
134+ __bjs_self. bridgeJSStackPush ( )
135+ return JSObject ( id: UInt32 ( bitPattern: _bjs_struct_lift_PlayBridgeJSResult ( ) ) )
136+ }
137+ }
138+
139+ #if arch(wasm32)
140+ @_extern ( wasm, module: " bjs " , name: " swift_js_struct_lower_PlayBridgeJSResult " )
141+ fileprivate func _bjs_struct_lower_PlayBridgeJSResult( _ objectId: Int32 ) -> Int32
142+ #else
143+ fileprivate func _bjs_struct_lower_PlayBridgeJSResult( _ objectId: Int32 ) -> Int32 {
144+ fatalError ( " Only available on WebAssembly " )
145+ }
146+ #endif
147+
148+ #if arch(wasm32)
149+ @_extern ( wasm, module: " bjs " , name: " swift_js_struct_lift_PlayBridgeJSResult " )
150+ fileprivate func _bjs_struct_lift_PlayBridgeJSResult( ) -> Int32
151+ #else
152+ fileprivate func _bjs_struct_lift_PlayBridgeJSResult( ) -> Int32 {
153+ fatalError ( " Only available on WebAssembly " )
154+ }
155+ #endif
156+
10157@_expose ( wasm, " bjs_PlayBridgeJS_init " )
11158@_cdecl ( " bjs_PlayBridgeJS_init " )
12159public func _bjs_PlayBridgeJS_init( ) -> UnsafeMutableRawPointer {
@@ -18,12 +165,12 @@ public func _bjs_PlayBridgeJS_init() -> UnsafeMutableRawPointer {
18165 #endif
19166}
20167
21- @_expose ( wasm, " bjs_PlayBridgeJS_update " )
22- @_cdecl ( " bjs_PlayBridgeJS_update " )
23- public func _bjs_PlayBridgeJS_update ( _ _self: UnsafeMutableRawPointer , _ swiftSourceBytes: Int32 , _ swiftSourceLength: Int32 , _ dtsSourceBytes: Int32 , _ dtsSourceLength: Int32 ) -> UnsafeMutableRawPointer {
168+ @_expose ( wasm, " bjs_PlayBridgeJS_updateDetailed " )
169+ @_cdecl ( " bjs_PlayBridgeJS_updateDetailed " )
170+ public func _bjs_PlayBridgeJS_updateDetailed ( _ _self: UnsafeMutableRawPointer , _ swiftSourceBytes: Int32 , _ swiftSourceLength: Int32 , _ dtsSourceBytes: Int32 , _ dtsSourceLength: Int32 ) -> Void {
24171 #if arch(wasm32)
25172 do {
26- let ret = try PlayBridgeJS . bridgeJSLiftParameter ( _self) . update ( swiftSource: String . bridgeJSLiftParameter ( swiftSourceBytes, swiftSourceLength) , dtsSource: String . bridgeJSLiftParameter ( dtsSourceBytes, dtsSourceLength) )
173+ let ret = try PlayBridgeJS . bridgeJSLiftParameter ( _self) . updateDetailed ( swiftSource: String . bridgeJSLiftParameter ( swiftSourceBytes, swiftSourceLength) , dtsSource: String . bridgeJSLiftParameter ( dtsSourceBytes, dtsSourceLength) )
27174 return ret. bridgeJSLowerReturn ( )
28175 } catch let error {
29176 if let error = error. thrownValue. object {
@@ -36,7 +183,7 @@ public func _bjs_PlayBridgeJS_update(_ _self: UnsafeMutableRawPointer, _ swiftSo
36183 _swift_js_throw ( Int32 ( bitPattern: $0. id) )
37184 }
38185 }
39- return UnsafeMutableRawPointer ( bitPattern : - 1 ) . unsafelyUnwrapped
186+ return
40187 }
41188 #else
42189 fatalError ( " Only available on WebAssembly " )
@@ -68,75 +215,6 @@ fileprivate func _bjs_PlayBridgeJS_wrap(_ pointer: UnsafeMutableRawPointer) -> I
68215}
69216#endif
70217
71- @_expose ( wasm, " bjs_PlayBridgeJSOutput_outputJs " )
72- @_cdecl ( " bjs_PlayBridgeJSOutput_outputJs " )
73- public func _bjs_PlayBridgeJSOutput_outputJs( _ _self: UnsafeMutableRawPointer ) -> Void {
74- #if arch(wasm32)
75- let ret = PlayBridgeJSOutput . bridgeJSLiftParameter ( _self) . outputJs ( )
76- return ret. bridgeJSLowerReturn ( )
77- #else
78- fatalError ( " Only available on WebAssembly " )
79- #endif
80- }
81-
82- @_expose ( wasm, " bjs_PlayBridgeJSOutput_outputDts " )
83- @_cdecl ( " bjs_PlayBridgeJSOutput_outputDts " )
84- public func _bjs_PlayBridgeJSOutput_outputDts( _ _self: UnsafeMutableRawPointer ) -> Void {
85- #if arch(wasm32)
86- let ret = PlayBridgeJSOutput . bridgeJSLiftParameter ( _self) . outputDts ( )
87- return ret. bridgeJSLowerReturn ( )
88- #else
89- fatalError ( " Only available on WebAssembly " )
90- #endif
91- }
92-
93- @_expose ( wasm, " bjs_PlayBridgeJSOutput_importSwiftMacroDecls " )
94- @_cdecl ( " bjs_PlayBridgeJSOutput_importSwiftMacroDecls " )
95- public func _bjs_PlayBridgeJSOutput_importSwiftMacroDecls( _ _self: UnsafeMutableRawPointer ) -> Void {
96- #if arch(wasm32)
97- let ret = PlayBridgeJSOutput . bridgeJSLiftParameter ( _self) . importSwiftMacroDecls ( )
98- return ret. bridgeJSLowerReturn ( )
99- #else
100- fatalError ( " Only available on WebAssembly " )
101- #endif
102- }
103-
104- @_expose ( wasm, " bjs_PlayBridgeJSOutput_swiftGlue " )
105- @_cdecl ( " bjs_PlayBridgeJSOutput_swiftGlue " )
106- public func _bjs_PlayBridgeJSOutput_swiftGlue( _ _self: UnsafeMutableRawPointer ) -> Void {
107- #if arch(wasm32)
108- let ret = PlayBridgeJSOutput . bridgeJSLiftParameter ( _self) . swiftGlue ( )
109- return ret. bridgeJSLowerReturn ( )
110- #else
111- fatalError ( " Only available on WebAssembly " )
112- #endif
113- }
114-
115- @_expose ( wasm, " bjs_PlayBridgeJSOutput_deinit " )
116- @_cdecl ( " bjs_PlayBridgeJSOutput_deinit " )
117- public func _bjs_PlayBridgeJSOutput_deinit( _ pointer: UnsafeMutableRawPointer ) -> Void {
118- #if arch(wasm32)
119- Unmanaged < PlayBridgeJSOutput > . fromOpaque ( pointer) . release ( )
120- #else
121- fatalError ( " Only available on WebAssembly " )
122- #endif
123- }
124-
125- extension PlayBridgeJSOutput : ConvertibleToJSValue , _BridgedSwiftHeapObject {
126- var jsValue : JSValue {
127- return . object( JSObject ( id: UInt32 ( bitPattern: _bjs_PlayBridgeJSOutput_wrap ( Unmanaged . passRetained ( self ) . toOpaque ( ) ) ) ) )
128- }
129- }
130-
131- #if arch(wasm32)
132- @_extern ( wasm, module: " PlayBridgeJS " , name: " bjs_PlayBridgeJSOutput_wrap " )
133- fileprivate func _bjs_PlayBridgeJSOutput_wrap( _ pointer: UnsafeMutableRawPointer ) -> Int32
134- #else
135- fileprivate func _bjs_PlayBridgeJSOutput_wrap( _ pointer: UnsafeMutableRawPointer ) -> Int32 {
136- fatalError ( " Only available on WebAssembly " )
137- }
138- #endif
139-
140218#if arch(wasm32)
141219@_extern ( wasm, module: " PlayBridgeJS " , name: " bjs_createTS2Swift " )
142220fileprivate func bjs_createTS2Swift( ) -> Int32
0 commit comments