@nstudio/nativescript-compiler 9.2.0-alpha.10 → 9.2.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/api/ir.js +7 -1
  2. package/dist/driver/cli.js +2 -0
  3. package/dist/driver/compile.js +22 -10
  4. package/dist/driver/unimplemented.js +15 -0
  5. package/dist/kotlin/access.js +22 -4
  6. package/dist/kotlin/arguments.js +5 -0
  7. package/dist/kotlin/builtins.js +0 -4
  8. package/dist/kotlin/calls.js +6 -2
  9. package/dist/kotlin/class-methods.js +9 -3
  10. package/dist/kotlin/components.js +13 -8
  11. package/dist/kotlin/core-api.js +2 -13
  12. package/dist/kotlin/declarations.js +2 -0
  13. package/dist/kotlin/expression-statements.js +5 -4
  14. package/dist/kotlin/functions.js +13 -4
  15. package/dist/kotlin/global-calls.js +11 -0
  16. package/dist/kotlin/literals.js +51 -5
  17. package/dist/kotlin/names.js +2 -2
  18. package/dist/kotlin/native/api.js +9 -1
  19. package/dist/kotlin/native/subclasses.js +4 -3
  20. package/dist/kotlin/native/types.js +8 -5
  21. package/dist/kotlin/operators.js +4 -1
  22. package/dist/kotlin/prototype-calls.js +5 -0
  23. package/dist/kotlin/render.js +62 -0
  24. package/dist/kotlin/statements.js +9 -0
  25. package/dist/kotlin/static-calls.js +4 -3
  26. package/dist/kotlin/types.js +6 -6
  27. package/dist/plugins/native-android.js +7 -3
  28. package/dist/plugins/native-ios.js +2 -0
  29. package/dist/plugins/source.js +73 -23
  30. package/dist/program/app-modules.js +91 -16
  31. package/dist/program/app-paths.js +80 -12
  32. package/dist/program/class-mixins.js +463 -0
  33. package/dist/program/core-facts.js +7 -0
  34. package/dist/program/glob.js +274 -0
  35. package/dist/program/platform.js +32 -4
  36. package/dist/program/program.js +212 -20
  37. package/dist/program/source-lines.js +4 -1
  38. package/dist/program/vite-plugins.js +144 -0
  39. package/dist/semantics/apis/globals.js +2 -2
  40. package/dist/semantics/apis/object.js +1 -0
  41. package/dist/semantics/apis/statics.js +6 -0
  42. package/dist/semantics/ast.js +20 -2
  43. package/dist/semantics/classes.js +36 -1
  44. package/dist/semantics/globals.js +3 -0
  45. package/dist/semantics/lang.js +13 -1
  46. package/dist/semantics/nullish.js +29 -11
  47. package/dist/semantics/refuse-receivers.js +3 -3
  48. package/dist/semantics/refuse-scope.js +2 -7
  49. package/dist/semantics/runtime.js +1 -0
  50. package/dist/semantics/states/value-states.js +1 -1
  51. package/dist/semantics/throws.js +1 -0
  52. package/dist/semantics/translator-methods.js +1 -1
  53. package/dist/semantics/types.js +21 -1
  54. package/dist/swift/access.js +25 -10
  55. package/dist/swift/arguments.js +10 -2
  56. package/dist/swift/assignment.js +12 -1
  57. package/dist/swift/builtins.js +0 -4
  58. package/dist/swift/calls.js +6 -2
  59. package/dist/swift/class-methods.js +3 -3
  60. package/dist/swift/components.js +28 -8
  61. package/dist/swift/construction.js +4 -0
  62. package/dist/swift/core-api.js +9 -12
  63. package/dist/swift/functions.js +13 -2
  64. package/dist/swift/generics.js +5 -1
  65. package/dist/swift/global-calls.js +2 -0
  66. package/dist/swift/literals.js +53 -6
  67. package/dist/swift/names.js +1 -1
  68. package/dist/swift/native/sdk-tables.js +52 -4
  69. package/dist/swift/native/sdk.js +9 -1
  70. package/dist/swift/operators.js +4 -1
  71. package/dist/swift/parameters.js +5 -2
  72. package/dist/swift/placement.js +42 -1
  73. package/dist/swift/prototype-calls.js +17 -2
  74. package/dist/swift/render.js +64 -0
  75. package/dist/swift/results.js +1 -1
  76. package/dist/swift/statements.js +9 -0
  77. package/dist/swift/static-calls.js +8 -3
  78. package/dist/swift/types.js +9 -9
  79. package/dist/targets/android/build.js +13 -9
  80. package/dist/targets/ios/build.js +11 -10
  81. package/dist/targets/ios/dependencies.js +12 -0
  82. package/dist/targets/resources.js +15 -1
  83. package/dist/template/plan.js +105 -8
  84. package/dist/types/adapter-api.d.ts +13 -0
  85. package/dist/types/ir.d.ts +47 -0
  86. package/kit-android/generated/kotlin/org/nativescript/kit/__Objects.kt +102 -7485
  87. package/kit-android/generated/kotlin/org/nativescript/kit/ui_core_view_view_common.kt +1 -3
  88. package/kit-android/generated/source-lines.json +1 -1
  89. package/kit-android/src/fromcore/kotlin/org/nativescript/kit/CoreBridge.kt +67 -1
  90. package/kit-android/src/main/kotlin/org/nativescript/kit/runtime/Prototypes.kt +26 -0
  91. package/kit-apple/Overlays/xml-free/Core/ui.core.bindable.index.swift +4 -4
  92. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity1.swift +24 -146
  93. package/kit-apple/Sources/NativeScriptKit/Core/FunctionCells.Arity2.swift +0 -281
  94. package/kit-apple/Sources/NativeScriptKit/Core/{Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpreadable_and_19_more_91b5f3.swift → Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpreadable_and_19_more_fa18e1.swift} +28 -103
  95. package/kit-apple/Sources/NativeScriptKit/Core/__Namespace.Utils.swift +17 -15
  96. package/kit-apple/Sources/NativeScriptKit/Core/application-settings.index.ios.swift +8 -8
  97. package/kit-apple/Sources/NativeScriptKit/Core/application.application-common.swift +4 -4
  98. package/kit-apple/Sources/NativeScriptKit/Core/color.color-common.swift +7 -7
  99. package/kit-apple/Sources/NativeScriptKit/Core/http.http-request-internal.index.ios.swift +2 -1
  100. package/kit-apple/Sources/NativeScriptKit/Core/image-source.index.ios.swift +1 -1
  101. package/kit-apple/Sources/NativeScriptKit/Core/kit-index.json +34 -244
  102. package/kit-apple/Sources/NativeScriptKit/Core/manifest.json +1 -2
  103. package/kit-apple/Sources/NativeScriptKit/Core/ui.action-bar.index.ios.swift +3 -3
  104. package/kit-apple/Sources/NativeScriptKit/Core/ui.button.index.ios.swift +4 -4
  105. package/kit-apple/Sources/NativeScriptKit/Core/ui.content-view.index.swift +8 -8
  106. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.bindable.index.swift +4 -4
  107. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.index.ios.swift +8 -8
  108. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-common.swift +1 -3
  109. package/kit-apple/Sources/NativeScriptKit/Core/ui.core.view.view-helper.view-helper-common.swift +7 -7
  110. package/kit-apple/Sources/NativeScriptKit/Core/ui.frame.index.ios.swift +4 -4
  111. package/kit-apple/Sources/NativeScriptKit/Core/ui.html-view.index.ios.swift +4 -4
  112. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.image-common.swift +2 -2
  113. package/kit-apple/Sources/NativeScriptKit/Core/ui.image.index.ios.swift +4 -4
  114. package/kit-apple/Sources/NativeScriptKit/Core/ui.label.index.ios.swift +4 -4
  115. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.absolute-layout.index.ios.swift +4 -4
  116. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.dock-layout.index.ios.swift +4 -4
  117. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.flexbox-layout.index.ios.swift +3 -3
  118. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.grid-layout.index.ios.swift +4 -4
  119. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.stack-layout.index.ios.swift +4 -4
  120. package/kit-apple/Sources/NativeScriptKit/Core/ui.layouts.wrap-layout.index.ios.swift +4 -4
  121. package/kit-apple/Sources/NativeScriptKit/Core/ui.list-view.index.ios.swift +3 -3
  122. package/kit-apple/Sources/NativeScriptKit/Core/ui.page.index.ios.swift +4 -4
  123. package/kit-apple/Sources/NativeScriptKit/Core/ui.repeater.index.swift +4 -4
  124. package/kit-apple/Sources/NativeScriptKit/Core/ui.scroll-view.index.ios.swift +4 -4
  125. package/kit-apple/Sources/NativeScriptKit/Core/ui.split-view.index.ios.swift +4 -4
  126. package/kit-apple/Sources/NativeScriptKit/Core/ui.styling.background.ios.swift +1 -1
  127. package/kit-apple/Sources/NativeScriptKit/Core/ui.tab-view.index.ios.swift +4 -4
  128. package/kit-apple/Sources/NativeScriptKit/Core/utils.common.swift +9 -9
  129. package/kit-apple/Sources/NativeScriptKit/Core/utils.layout-helper.index.ios.swift +10 -10
  130. package/kit-apple/Sources/NativeScriptKit/CoreBridge.swift +67 -1
  131. package/kit-apple/Sources/NativeScriptKit/Runtime/Lowering.swift +4 -0
  132. package/kit-apple/Sources/NativeScriptKit/Runtime/Prototypes.swift +25 -0
  133. package/kit-apple/Sources/NativeScriptKit/Runtime/RegExp.swift +6 -0
  134. package/package.json +1 -1
  135. package/kit-apple/Sources/NativeScriptKit/Core/Object_toString_charAt_charCodeAt_concat_indexOf_lastIndexOf_and_44_more_fc25df.swift +0 -481
@@ -15,12 +15,12 @@ import SystemConfiguration
15
15
  import UIKit
16
16
  import WebKit
17
17
 
18
- public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpreadable_and_19_more_91b5f3: JSDynamic,
19
- JSToPrimitive, JSObjectConvertible
18
+ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpreadable_and_19_more_fa18e1: JSDynamic,
19
+ JSToPrimitive
20
20
  {
21
21
  nonisolated deinit {}
22
22
  public var iterator: JSSymbol
23
- public var prototype: Any? { didSet { jsWrote("prototype", oldValue != nil, self.prototype == nil) } }
23
+ public var prototype: Any?
24
24
  public var `for`: ((String) throws -> JSSymbol)?
25
25
  public var keyFor: ((JSSymbol) throws -> String)?
26
26
  public var hasInstance: JSSymbol
@@ -35,32 +35,26 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
35
35
  public var unscopables: JSSymbol
36
36
  public var asyncIterator: JSSymbol
37
37
  public var matchAll: JSSymbol
38
- public var apply: ((Any?, Any?) throws -> Any?)? { didSet { jsWrote("apply", oldValue != nil, self.apply == nil) } }
39
- public var call: ((Any?, JSRest<Any?>) throws -> Any?)? {
40
- didSet { jsWrote("call", oldValue != nil, self.call == nil) }
41
- }
42
- public var bind: ((Any?, JSRest<Any?>) throws -> Any?)? {
43
- didSet { jsWrote("bind", oldValue != nil, self.bind == nil) }
44
- }
38
+ public var apply: Any?
39
+ public var call: Any?
40
+ public var bind: Any?
45
41
  public var toString: (() throws -> String)?
46
42
  public var length: Double
47
- public var arguments: Any? { didSet { jsWrote("arguments", oldValue != nil, self.arguments == nil) } }
48
- public var caller: Any? { didSet { jsWrote("caller", oldValue != nil, self.caller == nil) } }
43
+ public var arguments: Any?
44
+ public var caller: Any?
49
45
  public var name: String
50
- public var ___hasInstance_257899473: ((Any?) throws -> Bool)?
46
+ public var jsHasInstance: (Any?) throws -> Bool
51
47
  public func jsToPrimitive(_ hint: String) throws -> Any? {
52
48
  try jsOrdinaryToPrimitive(hint, valueOf: nil, toString: { try jsCallable(self.toString, "toString")() })
53
49
  }
54
- private var jsOrder: [String]?
50
+ private let jsOrder: [String]?
55
51
  public init(
56
52
  iterator: JSSymbol, prototype: Any? = nil, `for`: ((String) throws -> JSSymbol)?,
57
53
  keyFor: ((JSSymbol) throws -> String)?, hasInstance: JSSymbol, isConcatSpreadable: JSSymbol, match: JSSymbol,
58
54
  replace: JSSymbol, search: JSSymbol, species: JSSymbol, split: JSSymbol, toPrimitive: JSSymbol,
59
- toStringTag: JSSymbol, unscopables: JSSymbol, asyncIterator: JSSymbol, matchAll: JSSymbol,
60
- apply: ((Any?, Any?) throws -> Any?)?, call: ((Any?, JSRest<Any?>) throws -> Any?)?,
61
- bind: ((Any?, JSRest<Any?>) throws -> Any?)?, toString: (() throws -> String)?, length: Double,
62
- arguments: Any? = nil, caller: Any? = nil, name: String, ___hasInstance_257899473: ((Any?) throws -> Bool)?,
63
- jsOrder: [String]? = nil, jsUnset: Set<String>? = nil
55
+ toStringTag: JSSymbol, unscopables: JSSymbol, asyncIterator: JSSymbol, matchAll: JSSymbol, apply: Any? = nil,
56
+ call: Any? = nil, bind: Any? = nil, toString: (() throws -> String)?, length: Double, arguments: Any? = nil,
57
+ caller: Any? = nil, name: String, jsHasInstance: @escaping (Any?) throws -> Bool, jsOrder: [String]? = nil
64
58
  ) {
65
59
  self.iterator = iterator
66
60
  self.prototype = prototype
@@ -86,72 +80,18 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
86
80
  self.arguments = arguments
87
81
  self.caller = caller
88
82
  self.name = name
89
- self.___hasInstance_257899473 = ___hasInstance_257899473
83
+ self.jsHasInstance = jsHasInstance
90
84
  self.jsOrder = jsOrder
91
- self.jsUnset = jsUnset
92
85
  }
93
86
  private var jsExtra: JSDynamic?
94
- public convenience init(jsObject: Any?) {
95
- self.init(
96
- iterator: (jsField(jsObject, "iterator") as! JSSymbol), prototype: jsField(jsObject, "prototype"),
97
- for: FunctionCell_String_to_JSSymbol.fromScriptOrNil(jsField(jsObject, "for")),
98
- keyFor: FunctionCell_JSSymbol_to_String.fromScriptOrNil(jsField(jsObject, "keyFor")),
99
- hasInstance: (jsField(jsObject, "hasInstance") as! JSSymbol),
100
- isConcatSpreadable: (jsField(jsObject, "isConcatSpreadable") as! JSSymbol),
101
- match: (jsField(jsObject, "match") as! JSSymbol), replace: (jsField(jsObject, "replace") as! JSSymbol),
102
- search: (jsField(jsObject, "search") as! JSSymbol), species: (jsField(jsObject, "species") as! JSSymbol),
103
- split: (jsField(jsObject, "split") as! JSSymbol),
104
- toPrimitive: (jsField(jsObject, "toPrimitive") as! JSSymbol),
105
- toStringTag: (jsField(jsObject, "toStringTag") as! JSSymbol),
106
- unscopables: (jsField(jsObject, "unscopables") as! JSSymbol),
107
- asyncIterator: (jsField(jsObject, "asyncIterator") as! JSSymbol),
108
- matchAll: (jsField(jsObject, "matchAll") as! JSSymbol),
109
- apply: FunctionCell_AnyOpt_AnyOpt_to_AnyOpt.fromScriptOrNil(jsField(jsObject, "apply")),
110
- call: FunctionCell_AnyOpt_JSArray_AnyOpt_to_AnyOpt.fromScriptOrNil(jsField(jsObject, "call")),
111
- bind: FunctionCell_AnyOpt_JSArray_AnyOpt_to_AnyOpt.fromScriptOrNil(jsField(jsObject, "bind")),
112
- toString: FunctionCell_none_to_String.fromScriptOrNil(jsField(jsObject, "toString")),
113
- length: jsLenientNumber(jsField(jsObject, "length")), arguments: jsField(jsObject, "arguments"),
114
- caller: jsField(jsObject, "caller"), name: jsLenientString(jsField(jsObject, "name")),
115
- ___hasInstance_257899473: FunctionCell_AnyOpt_to_Bool.fromScriptOrNil(
116
- jsField(jsObject, "__@hasInstance@257899473")), jsOrder: (jsObject as? JSDynamic)?.jsKeys)
117
- jsUnset = jsUnsetKeys(jsObject, ["prototype", "apply", "call", "bind", "arguments", "caller"])
118
- jsExtra = jsObject as? JSDynamic
119
- }
120
- private var jsUnset: Set<String>?
121
- private func jsHas(_ key: String) -> Bool {
122
- switch key {
123
- case "prototype": return self.prototype != nil || jsUnset?.contains("prototype") == true
124
- case "apply": return self.apply != nil || jsUnset?.contains("apply") == true
125
- case "call": return self.call != nil || jsUnset?.contains("call") == true
126
- case "bind": return self.bind != nil || jsUnset?.contains("bind") == true
127
- case "arguments": return self.arguments != nil || jsUnset?.contains("arguments") == true
128
- case "caller": return self.caller != nil || jsUnset?.contains("caller") == true
129
- default: return true
130
- }
131
- }
132
- private func jsWrote(_ key: String, _ had: Bool, _ unset: Bool) {
133
- let was = had || jsUnset?.contains(key) == true
134
- if unset { jsUnset = (jsUnset ?? []).union([key]) } else { jsUnset?.remove(key) }
135
- if !was {
136
- jsOrder =
137
- (jsOrder ?? [
138
- "iterator", "prototype", "for", "keyFor", "hasInstance", "isConcatSpreadable", "match", "replace",
139
- "search", "species", "split", "toPrimitive", "toStringTag", "unscopables", "asyncIterator",
140
- "matchAll", "apply", "call", "bind", "toString", "length", "arguments", "caller", "name",
141
- "__@hasInstance@257899473",
142
- ]).filter { $0 != key && jsHas($0) } + [key]
143
- }
144
- }
145
87
  public var jsKeys: [String] {
146
- let order =
147
- jsOrder ?? [
148
- "iterator", "prototype", "for", "keyFor", "hasInstance", "isConcatSpreadable", "match", "replace",
149
- "search", "species", "split", "toPrimitive", "toStringTag", "unscopables", "asyncIterator", "matchAll",
150
- "apply", "call", "bind", "toString", "length", "arguments", "caller", "name",
151
- "__@hasInstance@257899473",
152
- ]
153
- let keys = order + (jsExtra?.jsKeys ?? []).filter { !order.contains($0) }
154
- return keys.filter(jsHas)
88
+ ["iterator"] + (self.prototype == nil ? [] : ["prototype"]) + ["for"] + ["keyFor"] + ["hasInstance"] + [
89
+ "isConcatSpreadable"
90
+ ] + ["match"] + ["replace"] + ["search"] + ["species"] + ["split"] + ["toPrimitive"] + ["toStringTag"] + [
91
+ "unscopables"
92
+ ] + ["asyncIterator"] + ["matchAll"] + (self.apply == nil ? [] : ["apply"]) + (self.call == nil ? [] : ["call"])
93
+ + (self.bind == nil ? [] : ["bind"]) + ["toString"] + ["length"]
94
+ + (self.arguments == nil ? [] : ["arguments"]) + (self.caller == nil ? [] : ["caller"]) + ["name"]
155
95
  }
156
96
  public var jsClassName: String? { nil }
157
97
  public subscript(jsKey key: String) -> Any? {
@@ -164,8 +104,8 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
164
104
  }
165
105
  case 4:
166
106
  switch key {
167
- case "call": return FunctionCell_AnyOpt_JSArray_AnyOpt_to_AnyOpt.scriptOrNil("", 1, self.call)
168
- case "bind": return FunctionCell_AnyOpt_JSArray_AnyOpt_to_AnyOpt.scriptOrNil("", 1, self.bind)
107
+ case "call": return self.call
108
+ case "bind": return self.bind
169
109
  case "name": return self.name
170
110
  default: break
171
111
  }
@@ -173,7 +113,7 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
173
113
  switch key {
174
114
  case "match": return self.match
175
115
  case "split": return self.split
176
- case "apply": return FunctionCell_AnyOpt_AnyOpt_to_AnyOpt.scriptOrNil("", 2, self.apply)
116
+ case "apply": return self.apply
177
117
  default: break
178
118
  }
179
119
  case 6:
@@ -221,15 +161,9 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
221
161
  case "isConcatSpreadable": return self.isConcatSpreadable
222
162
  default: break
223
163
  }
224
- case 24:
225
- switch key {
226
- case "__@hasInstance@257899473":
227
- return FunctionCell_AnyOpt_to_Bool.scriptOrNil("", 1, self.___hasInstance_257899473)
228
- default: break
229
- }
230
164
  default: break
231
165
  }
232
- return jsExtra?[jsKey: key] ?? nil
166
+ return nil
233
167
  }
234
168
  set {
235
169
  switch key.utf8.count {
@@ -243,10 +177,10 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
243
177
  case 4:
244
178
  switch key {
245
179
  case "call":
246
- self.call = FunctionCell_AnyOpt_JSArray_AnyOpt_to_AnyOpt.fromScriptOrNil(newValue)
180
+ self.call = newValue
247
181
  return
248
182
  case "bind":
249
- self.bind = FunctionCell_AnyOpt_JSArray_AnyOpt_to_AnyOpt.fromScriptOrNil(newValue)
183
+ self.bind = newValue
250
184
  return
251
185
  case "name":
252
186
  jsStoring { self.name = (try jsConvertedString(newValue)) }
@@ -270,7 +204,7 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
270
204
  }
271
205
  return
272
206
  case "apply":
273
- self.apply = FunctionCell_AnyOpt_AnyOpt_to_AnyOpt.fromScriptOrNil(newValue)
207
+ self.apply = newValue
274
208
  return
275
209
  default: break
276
210
  }
@@ -397,17 +331,8 @@ public final class Object_iterator_prototype_for_keyFor_hasInstance_isConcatSpre
397
331
  return
398
332
  default: break
399
333
  }
400
- case 24:
401
- switch key {
402
- case "__@hasInstance@257899473":
403
- self.___hasInstance_257899473 = FunctionCell_AnyOpt_to_Bool.fromScriptOrNil(newValue)
404
- return
405
- default: break
406
- }
407
334
  default: break
408
335
  }
409
- if jsExtra == nil { jsExtra = JSObject() }
410
- jsExtra?[jsKey: key] = newValue
411
336
  }
412
337
  }
413
338
  }
@@ -26,8 +26,8 @@ extension Utils {
26
26
  public static func escapeRegexSymbols(_ source: String) throws -> String {
27
27
  return try NativeScriptKit.Core_utils_common.escapeRegexSymbols(source)
28
28
  }
29
- public static func convertString(_ value: Any?) -> Any? {
30
- return NativeScriptKit.Core_utils_common.convertString(value)
29
+ public static func convertString(_ value: Any?) throws -> Any? {
30
+ return try NativeScriptKit.Core_utils_common.convertString(value)
31
31
  }
32
32
  public static func getModuleName(_ path: String) throws -> String {
33
33
  return try NativeScriptKit.Core_utils_common.getModuleName(path)
@@ -35,13 +35,15 @@ extension Utils {
35
35
  public static func sanitizeModuleName(_ moduleName: String, _ removeExtension: Bool = true) throws -> String {
36
36
  return try NativeScriptKit.Core_utils_common.sanitizeModuleName(moduleName, removeExtension)
37
37
  }
38
- public static func isFileOrResourcePath(_ path: String) -> Bool {
39
- return NativeScriptKit.Core_utils_common.isFileOrResourcePath(path)
38
+ public static func isFileOrResourcePath(_ path: String) throws -> Bool {
39
+ return try NativeScriptKit.Core_utils_common.isFileOrResourcePath(path)
40
40
  }
41
- public static func isFontIconURI(_ uri: String) -> Bool {
42
- return NativeScriptKit.Core_utils_common.isFontIconURI(uri)
41
+ public static func isFontIconURI(_ uri: String) throws -> Bool {
42
+ return try NativeScriptKit.Core_utils_common.isFontIconURI(uri)
43
+ }
44
+ public static func isSystemURI(_ uri: String) throws -> Bool {
45
+ return try NativeScriptKit.Core_utils_common.isSystemURI(uri)
43
46
  }
44
- public static func isSystemURI(_ uri: String) -> Bool { return NativeScriptKit.Core_utils_common.isSystemURI(uri) }
45
47
  public static func isDataURI(_ uri: String) throws -> Bool {
46
48
  return try NativeScriptKit.Core_utils_common.isDataURI(uri)
47
49
  }
@@ -93,12 +95,12 @@ extension Utils {
93
95
  }
94
96
  public static var debug: Bool { NativeScriptKit.Core_utils_debug.debug }
95
97
  public enum layout {
96
- public static func getMode(_ mode: Double) -> String { return NativeScriptKit.layout.getMode(mode) }
97
- public static func getMeasureSpecMode(_ spec: Double) -> Double {
98
- return NativeScriptKit.layout.getMeasureSpecMode(spec)
98
+ public static func getMode(_ mode: Double) throws -> String { return try NativeScriptKit.layout.getMode(mode) }
99
+ public static func getMeasureSpecMode(_ spec: Double) throws -> Double {
100
+ return try NativeScriptKit.layout.getMeasureSpecMode(spec)
99
101
  }
100
- public static func getMeasureSpecSize(_ spec: Double) -> Double {
101
- return NativeScriptKit.layout.getMeasureSpecSize(spec)
102
+ public static func getMeasureSpecSize(_ spec: Double) throws -> Double {
103
+ return try NativeScriptKit.layout.getMeasureSpecSize(spec)
102
104
  }
103
105
  public static func makeMeasureSpec(_ size: Double, _ mode: Double) -> Double {
104
106
  return NativeScriptKit.layout.makeMeasureSpec(size, mode)
@@ -113,14 +115,14 @@ extension Utils {
113
115
  public static func toDeviceIndependentPixels(_ value: Double) throws -> Double {
114
116
  return try NativeScriptKit.layout.toDeviceIndependentPixels(value)
115
117
  }
116
- public static func round(_ value: Double) -> Double { return NativeScriptKit.layout.round(value) }
118
+ public static func round(_ value: Double) throws -> Double { return try NativeScriptKit.layout.round(value) }
117
119
  public static func measureNativeView(
118
120
  _ nativeView: Any?, _ width: Double, _ widthMode: Double, _ height: Double, _ heightMode: Double
119
121
  ) throws -> Any? {
120
122
  return try NativeScriptKit.layout.measureNativeView(nativeView, width, widthMode, height, heightMode)
121
123
  }
122
- public static func measureSpecToString(_ measureSpec: Double) -> String {
123
- return NativeScriptKit.layout.measureSpecToString(measureSpec)
124
+ public static func measureSpecToString(_ measureSpec: Double) throws -> String {
125
+ return try NativeScriptKit.layout.measureSpecToString(measureSpec)
124
126
  }
125
127
  public static var MODE_SHIFT: Double { NativeScriptKit.layout.MODE_SHIFT }
126
128
  public static var MODE_MASK: Double { NativeScriptKit.layout.MODE_MASK }
@@ -19,7 +19,7 @@ public enum ApplicationSettings {
19
19
  public static var userDefaults: UserDefaults?
20
20
  public static func hasKey(_ key: String) throws -> Bool? {
21
21
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:8)
22
- if !Core_application_settings_application_settings_common.checkKey(key) {
22
+ if try !Core_application_settings_application_settings_common.checkKey(key) {
23
23
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:9)
24
24
  return nil
25
25
  }
@@ -29,7 +29,7 @@ public enum ApplicationSettings {
29
29
  #sourceLocation()
30
30
  public static func getBoolean(_ key: String, _ defaultValue: Bool? = nil) throws -> Bool? {
31
31
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:17)
32
- if !Core_application_settings_application_settings_common.checkKey(key) {
32
+ if try !Core_application_settings_application_settings_common.checkKey(key) {
33
33
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:18)
34
34
  return nil
35
35
  }
@@ -44,7 +44,7 @@ public enum ApplicationSettings {
44
44
  #sourceLocation()
45
45
  public static func getString(_ key: String, _ defaultValue: String? = nil) throws -> String? {
46
46
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:28)
47
- if !Core_application_settings_application_settings_common.checkKey(key) {
47
+ if try !Core_application_settings_application_settings_common.checkKey(key) {
48
48
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:29)
49
49
  return nil
50
50
  }
@@ -59,7 +59,7 @@ public enum ApplicationSettings {
59
59
  #sourceLocation()
60
60
  public static func getNumber(_ key: String, _ defaultValue: Double? = nil) throws -> Double? {
61
61
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:39)
62
- if !Core_application_settings_application_settings_common.checkKey(key) {
62
+ if try !Core_application_settings_application_settings_common.checkKey(key) {
63
63
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:40)
64
64
  return nil
65
65
  }
@@ -74,7 +74,7 @@ public enum ApplicationSettings {
74
74
  #sourceLocation()
75
75
  public static func setBoolean(_ key: String, _ value: Bool) throws {
76
76
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:51)
77
- if !Core_application_settings_application_settings_common.checkKey(key) {
77
+ if try !Core_application_settings_application_settings_common.checkKey(key) {
78
78
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:52)
79
79
  return
80
80
  }
@@ -89,7 +89,7 @@ public enum ApplicationSettings {
89
89
  #sourceLocation()
90
90
  public static func setString(_ key: String, _ value: String) throws {
91
91
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:61)
92
- if !Core_application_settings_application_settings_common.checkKey(key) {
92
+ if try !Core_application_settings_application_settings_common.checkKey(key) {
93
93
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:62)
94
94
  return
95
95
  }
@@ -104,7 +104,7 @@ public enum ApplicationSettings {
104
104
  #sourceLocation()
105
105
  public static func setNumber(_ key: String, _ value: Double) throws {
106
106
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:71)
107
- if !Core_application_settings_application_settings_common.checkKey(key) {
107
+ if try !Core_application_settings_application_settings_common.checkKey(key) {
108
108
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:72)
109
109
  return
110
110
  }
@@ -119,7 +119,7 @@ public enum ApplicationSettings {
119
119
  #sourceLocation()
120
120
  public static func remove(_ key: String) throws {
121
121
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:81)
122
- if !Core_application_settings_application_settings_common.checkKey(key) {
122
+ if try !Core_application_settings_application_settings_common.checkKey(key) {
123
123
  #sourceLocation(file:"@nativescript/core/application-settings.index.ios.ts",line:82)
124
124
  return
125
125
  }
@@ -1061,15 +1061,15 @@ open class ApplicationCommon: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
1061
1061
  }
1062
1062
  #sourceLocation()
1063
1063
  /// Get application level static resources.
1064
- open func getResources() -> Any? {
1064
+ open func getResources() throws -> Any? {
1065
1065
  #sourceLocation(file:"@nativescript/core/application.application-common.ts",line:893)
1066
- return Core_ui_core_bindable_bindable_resources.get()
1066
+ return try Core_ui_core_bindable_bindable_resources.get()
1067
1067
  }
1068
1068
  #sourceLocation()
1069
1069
  /// Set application level static resources.
1070
- open func setResources(_ res: Any?) {
1070
+ open func setResources(_ res: Any?) throws {
1071
1071
  #sourceLocation(file:"@nativescript/core/application.application-common.ts",line:900)
1072
- Core_ui_core_bindable_bindable_resources.set(res)
1072
+ try Core_ui_core_bindable_bindable_resources.set(res)
1073
1073
  }
1074
1074
  #sourceLocation()
1075
1075
  /// Sets css file name for the application.
@@ -29,7 +29,7 @@ open class ColorBase: JSDynamic, JSStringConvertible, JSExpando, JSKeysMade, JSS
29
29
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:15)
30
30
  let arg: Any? = try ((jsUnwrap(args, "0").element(0) ?? nil) as Any?)
31
31
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:16)
32
- if Core_utils_types.isString(arg) {
32
+ if try Core_utils_types.isString(arg) {
33
33
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:17)
34
34
  let lowered: String = jsLenientString(arg).lowercased()
35
35
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:18)
@@ -47,9 +47,9 @@ open class ColorBase: JSDynamic, JSStringConvertible, JSExpando, JSKeysMade, JSS
47
47
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:23)
48
48
  self._argb = try Core_color_color_utils.argbFromHsvOrHsva(lowered)
49
49
  if jsMadeBits0 & (1 << 0) == 0 { jsMadeNote(&jsMadeBits0, &jsMade, 1 << 0, "_argb") }
50
- } else if jsTruthy(Core_color_known_colors.isKnownName(lowered) as Any?) {
50
+ } else if try jsTruthy(Core_color_known_colors.isKnownName(lowered) as Any?) {
51
51
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:26)
52
- let argb: Double? = Core_color_known_colors.getKnownColor(lowered)
52
+ let argb: Double? = try Core_color_known_colors.getKnownColor(lowered)
53
53
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:27)
54
54
  self._name = jsLenientString(arg)
55
55
  if jsMadeBits0 & (1 << 1) == 0 { jsMadeNote(&jsMadeBits0, &jsMade, 1 << 1, "_name") }
@@ -93,7 +93,7 @@ open class ColorBase: JSDynamic, JSStringConvertible, JSExpando, JSKeysMade, JSS
93
93
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:47)
94
94
  throw JSException(value: JSError("Invalid color: " + jsLenientString(arg)))
95
95
  }
96
- } else if Core_utils_types.isNumber(arg) {
96
+ } else if try Core_utils_types.isNumber(arg) {
97
97
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:52)
98
98
  self._argb = jsShiftRightUnsigned(jsLenientNumber(arg), 0)
99
99
  if jsMadeBits0 & (1 << 0) == 0 { jsMadeNote(&jsMadeBits0, &jsMade, 1 << 0, "_argb") }
@@ -260,21 +260,21 @@ open class ColorBase: JSDynamic, JSStringConvertible, JSExpando, JSKeysMade, JSS
260
260
  return try jsLenientBool(jsCallMethod(value1, "equals", value2))
261
261
  }
262
262
  #sourceLocation()
263
- open class func isValid(_ value: Any?) -> Bool {
263
+ open class func isValid(_ value: Any?) throws -> Bool {
264
264
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:143)
265
265
  if value is ColorBase {
266
266
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:144)
267
267
  return true
268
268
  }
269
269
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:147)
270
- if !Core_utils_types.isString(value) {
270
+ if try !Core_utils_types.isString(value) {
271
271
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:148)
272
272
  return false
273
273
  }
274
274
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:150)
275
275
  let lowered: String = jsLenientString(value).lowercased()
276
276
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:152)
277
- if jsTruthy(Core_color_known_colors.isKnownName(lowered) as Any?) {
277
+ if try jsTruthy(Core_color_known_colors.isKnownName(lowered) as Any?) {
278
278
  #sourceLocation(file:"@nativescript/core/color.color-common.ts",line:153)
279
279
  return true
280
280
  }
@@ -331,7 +331,8 @@ public enum Core_http_http_request_internal_index {
331
331
  ),
332
332
  ])
333
333
  #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:173)
334
- if !jsIsNullish(contentHandler) && Core_utils_types.isObject(contentHandler)
334
+ if try !jsIsNullish(contentHandler)
335
+ && Core_utils_types.isObject(contentHandler)
335
336
  && !(JSArray<Any?>.isArray(contentHandler))
336
337
  {
337
338
  #sourceLocation(file:"@nativescript/core/http.http-request-internal.index.ios.ts",line:174)
@@ -296,7 +296,7 @@ open class ImageSource: JSDynamic, JSExpando, JSKeysMade, JSStaticKeyed {
296
296
  #sourceLocation()
297
297
  open class func fromFileOrResourceSync(_ path: String) throws -> ImageSource? {
298
298
  #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:159)
299
- if !Core_utils_common.isFileOrResourcePath(path) {
299
+ if try !Core_utils_common.isFileOrResourcePath(path) {
300
300
  #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:160)
301
301
  if NativeScriptKit.Trace.isEnabled() {
302
302
  #sourceLocation(file:"@nativescript/core/image-source.index.ios.ts",line:161)