-
-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathEnumCase.swift
More file actions
216 lines (198 loc) · 5.82 KB
/
EnumCase.swift
File metadata and controls
216 lines (198 loc) · 5.82 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
// 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(BridgeJS) import JavaScriptKit
extension Direction {
@_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> Int32 {
return bridgeJSRawValue
}
@_spi(BridgeJS) @_transparent public static func bridgeJSLiftReturn(_ value: Int32) -> Direction {
return Direction(bridgeJSRawValue: value)!
}
@_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter(_ value: Int32) -> Direction {
return Direction(bridgeJSRawValue: value)!
}
@_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() -> Int32 {
return bridgeJSRawValue
}
private init?(bridgeJSRawValue: Int32) {
switch bridgeJSRawValue {
case 0:
self = .north
case 1:
self = .south
case 2:
self = .east
case 3:
self = .west
default:
return nil
}
}
private var bridgeJSRawValue: Int32 {
switch self {
case .north:
return 0
case .south:
return 1
case .east:
return 2
case .west:
return 3
}
}
}
extension Status {
@_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> Int32 {
return bridgeJSRawValue
}
@_spi(BridgeJS) @_transparent public static func bridgeJSLiftReturn(_ value: Int32) -> Status {
return Status(bridgeJSRawValue: value)!
}
@_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter(_ value: Int32) -> Status {
return Status(bridgeJSRawValue: value)!
}
@_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() -> Int32 {
return bridgeJSRawValue
}
private init?(bridgeJSRawValue: Int32) {
switch bridgeJSRawValue {
case 0:
self = .loading
case 1:
self = .success
case 2:
self = .error
default:
return nil
}
}
private var bridgeJSRawValue: Int32 {
switch self {
case .loading:
return 0
case .success:
return 1
case .error:
return 2
}
}
}
extension TSDirection {
@_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> Int32 {
return bridgeJSRawValue
}
@_spi(BridgeJS) @_transparent public static func bridgeJSLiftReturn(_ value: Int32) -> TSDirection {
return TSDirection(bridgeJSRawValue: value)!
}
@_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter(_ value: Int32) -> TSDirection {
return TSDirection(bridgeJSRawValue: value)!
}
@_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() -> Int32 {
return bridgeJSRawValue
}
private init?(bridgeJSRawValue: Int32) {
switch bridgeJSRawValue {
case 0:
self = .north
case 1:
self = .south
case 2:
self = .east
case 3:
self = .west
default:
return nil
}
}
private var bridgeJSRawValue: Int32 {
switch self {
case .north:
return 0
case .south:
return 1
case .east:
return 2
case .west:
return 3
}
}
}
extension PublicStatus {
@_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerParameter() -> Int32 {
return bridgeJSRawValue
}
@_spi(BridgeJS) @_transparent public static func bridgeJSLiftReturn(_ value: Int32) -> PublicStatus {
return PublicStatus(bridgeJSRawValue: value)!
}
@_spi(BridgeJS) @_transparent public static func bridgeJSLiftParameter(_ value: Int32) -> PublicStatus {
return PublicStatus(bridgeJSRawValue: value)!
}
@_spi(BridgeJS) @_transparent public consuming func bridgeJSLowerReturn() -> Int32 {
return bridgeJSRawValue
}
private init?(bridgeJSRawValue: Int32) {
switch bridgeJSRawValue {
case 0:
self = .success
default:
return nil
}
}
private var bridgeJSRawValue: Int32 {
switch self {
case .success:
return 0
}
}
}
@_expose(wasm, "bjs_setDirection")
@_cdecl("bjs_setDirection")
public func _bjs_setDirection(direction: Int32) -> Void {
#if arch(wasm32)
setDirection(_: Direction.bridgeJSLiftParameter(direction))
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_getDirection")
@_cdecl("bjs_getDirection")
public func _bjs_getDirection() -> Int32 {
#if arch(wasm32)
let ret = getDirection()
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_processDirection")
@_cdecl("bjs_processDirection")
public func _bjs_processDirection(input: Int32) -> Int32 {
#if arch(wasm32)
let ret = processDirection(_: Direction.bridgeJSLiftParameter(input))
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_setTSDirection")
@_cdecl("bjs_setTSDirection")
public func _bjs_setTSDirection(direction: Int32) -> Void {
#if arch(wasm32)
setTSDirection(_: TSDirection.bridgeJSLiftParameter(direction))
#else
fatalError("Only available on WebAssembly")
#endif
}
@_expose(wasm, "bjs_getTSDirection")
@_cdecl("bjs_getTSDirection")
public func _bjs_getTSDirection() -> Int32 {
#if arch(wasm32)
let ret = getTSDirection()
return ret.bridgeJSLowerReturn()
#else
fatalError("Only available on WebAssembly")
#endif
}