Home
last modified time | relevance | path

Searched refs:appContext (Results 1 – 25 of 561) sorted by relevance

12345678910>>...23

/expo/packages/expo-modules-core/ios/Tests/
H A DConvertiblesSpec.swift15 let url = try URL.convert(from: remoteUrlString, appContext: appContext) in spec()
24 let url = try URL.convert(from: urlString, appContext: appContext) in spec()
38 let url = try URL.convert(from: urlString, appContext: appContext) in spec()
52 let url = try URL.convert(from: urlString, appContext: appContext) in spec()
63 let url = try URL.convert(from: urlString, appContext: appContext) in spec()
80 let url = try URL.convert(from: urlString, appContext: appContext) in spec()
98 let url = try URL.convert(from: filePath, appContext: appContext) in spec()
108 let url = try URL.convert(from: filePath, appContext: appContext) in spec()
117 let url = try URL.convert(from: filePath, appContext: appContext) in spec()
125 expect { try URL.convert(from: 29.5, appContext: appContext) }.to( in spec()
[all …]
H A DModuleEventListenersSpec.swift15 var appContext: AppContext! in spec() variable
18 appContext = AppContext() in spec()
23 _ = mockModuleHolder(appContext) { in spec()
34 let holder = mockModuleHolder(appContext) { in spec()
40 appContext.moduleRegistry.register(holder: holder) in spec()
49 let holder = mockModuleHolder(appContext) { in spec()
62 let holder = mockModuleHolder(appContext) { in spec()
68 appContext.moduleRegistry.post(event: event) in spec()
74 let holder = mockModuleHolder(appContext) { in spec()
86 let holder = mockModuleHolder(appContext) { in spec()
[all …]
H A DDynamicTypeSpec.swift22 expect(try (~String.self).cast("expo", appContext: appContext) as? String) == "expo" in spec()
23 expect(try (~Double.self).cast(2.1, appContext: appContext) as? Double) == 2.1 in spec()
24 expect(try (~Bool.self).cast(false, appContext: appContext) as? Bool) == false in spec()
30 expect { try (~Double.self).cast(anyValue, appContext: appContext) }.to( in spec()
35 expect { try (~String.self).cast(true, appContext: appContext) }.to( in spec()
83 let result = try (~[Double].self).cast(anyValue, appContext: appContext) as! [Any] in spec()
91 expect(try (~[Int].self).cast(50, appContext: appContext) as? [Int]) == [50] in spec()
95 expect { try (~[String].self).cast(84, appContext: appContext) }.to( in spec()
240 expect(try (~Bool?.self).cast(false, appContext: appContext) as? Bool) == false in spec()
244 let result = try (~Double?.self).cast(value as Any, appContext: appContext) in spec()
[all …]
H A DRecordSpec.swift7 let appContext = AppContext.create() in spec() variable
11 _ = try TestRecord(from: [:], appContext: appContext) in spec()
19 let record = try TestRecord(from: dict, appContext: appContext) in spec()
30 let record = try TestRecord(from: dict, appContext: appContext) in spec()
41 expect { try TestRecord(from: [:], appContext: appContext) }.to(throwError { error in in spec()
52 expect { try TestRecord(from: dict, appContext: appContext) }.to(throwError { error in in spec()
/expo/ios/versioned/sdk49/ExpoModulesCore/ios/Tests/
H A DConvertiblesSpec.swift15 let url = try URL.convert(from: remoteUrlString, appContext: appContext) in spec()
24 let url = try URL.convert(from: urlString, appContext: appContext) in spec()
38 let url = try URL.convert(from: urlString, appContext: appContext) in spec()
52 let url = try URL.convert(from: urlString, appContext: appContext) in spec()
63 let url = try URL.convert(from: urlString, appContext: appContext) in spec()
80 let url = try URL.convert(from: urlString, appContext: appContext) in spec()
98 let url = try URL.convert(from: filePath, appContext: appContext) in spec()
108 let url = try URL.convert(from: filePath, appContext: appContext) in spec()
117 let url = try URL.convert(from: filePath, appContext: appContext) in spec()
125 expect { try URL.convert(from: 29.5, appContext: appContext) }.to( in spec()
[all …]
H A DModuleEventListenersSpec.swift15 var appContext: AppContext! in spec() variable
18 appContext = AppContext() in spec()
23 _ = mockModuleHolder(appContext) { in spec()
34 let holder = mockModuleHolder(appContext) { in spec()
40 appContext.moduleRegistry.register(holder: holder) in spec()
49 let holder = mockModuleHolder(appContext) { in spec()
62 let holder = mockModuleHolder(appContext) { in spec()
68 appContext.moduleRegistry.post(event: event) in spec()
74 let holder = mockModuleHolder(appContext) { in spec()
86 let holder = mockModuleHolder(appContext) { in spec()
[all …]
H A DDynamicTypeSpec.swift22 expect(try (~String.self).cast("expo", appContext: appContext) as? String) == "expo" in spec()
23 expect(try (~Double.self).cast(2.1, appContext: appContext) as? Double) == 2.1 in spec()
24 expect(try (~Bool.self).cast(false, appContext: appContext) as? Bool) == false in spec()
30 expect { try (~Double.self).cast(anyValue, appContext: appContext) }.to( in spec()
35 expect { try (~String.self).cast(true, appContext: appContext) }.to( in spec()
83 let result = try (~[Double].self).cast(anyValue, appContext: appContext) as! [Any] in spec()
91 expect(try (~[Int].self).cast(50, appContext: appContext) as? [Int]) == [50] in spec()
95 expect { try (~[String].self).cast(84, appContext: appContext) }.to( in spec()
240 expect(try (~Bool?.self).cast(false, appContext: appContext) as? Bool) == false in spec()
244 let result = try (~Double?.self).cast(value as Any, appContext: appContext) in spec()
[all …]
H A DRecordSpec.swift7 let appContext = AppContext.create() in spec() variable
11 _ = try TestRecord(from: [:], appContext: appContext) in spec()
19 let record = try TestRecord(from: dict, appContext: appContext) in spec()
30 let record = try TestRecord(from: dict, appContext: appContext) in spec()
41 expect { try TestRecord(from: [:], appContext: appContext) }.to(throwError { error in in spec()
52 expect { try TestRecord(from: dict, appContext: appContext) }.to(throwError { error in in spec()
/expo/packages/expo-modules-core/ios/Tests/Mocks/
H A DModuleMocks.swift22 init(appContext: AppContext, _ body: @escaping MockedDefinitionFunc) {
24 super.init(appContext: appContext)
27 required init(appContext: AppContext) {
34 func mockModuleHolder(_ appContext: AppContext, @ModuleDefinitionBuilder _ definitionBody: @escapin…
35 …return ModuleHolder(appContext: appContext, module: CustomModule(appContext: appContext, { _ in de…
38 func mockModuleHolder(_ appContext: AppContext, @ModuleDefinitionBuilder _ definitionBody: @escapin…
39 …return ModuleHolder(appContext: appContext, module: CustomModule(appContext: appContext, { module …
/expo/ios/versioned/sdk49/ExpoModulesCore/ios/Tests/Mocks/
H A DModuleMocks.swift22 init(appContext: AppContext, _ body: @escaping MockedDefinitionFunc) {
24 super.init(appContext: appContext)
27 required init(appContext: AppContext) {
34 func mockModuleHolder(_ appContext: AppContext, @ModuleDefinitionBuilder _ definitionBody: @escapin…
35 …return ModuleHolder(appContext: appContext, module: CustomModule(appContext: appContext, { _ in de…
38 func mockModuleHolder(_ appContext: AppContext, @ModuleDefinitionBuilder _ definitionBody: @escapin…
39 …return ModuleHolder(appContext: appContext, module: CustomModule(appContext: appContext, { module …
/expo/packages/expo-modules-core/ios/Swift/Objects/
H A DObjectDefinition.swift64 public func build(appContext: AppContext) throws -> JavaScriptObject { in build()
65 let object = try appContext.runtime.createObject() in build()
66 try decorate(object: object, appContext: appContext) in build()
70 public func decorate(object: JavaScriptObject, appContext: AppContext) throws { in decorate()
71 let runtime = try appContext.runtime in decorate()
74 try decorateWithFunctions(object: object, appContext: appContext) in decorate()
75 try decorateWithProperties(object: object, appContext: appContext) in decorate()
76 try decorateWithClasses(object: object, appContext: appContext) in decorate()
89 object.setProperty(fn.name, value: try fn.build(appContext: appContext)) in decorateWithFunctions()
95 let descriptor = try property.buildDescriptor(appContext: appContext) in decorateWithProperties()
[all …]
H A DPropertyComponent.swift124 let value = try getter?.call(by: owner, withArguments: [], appContext: appContext) in buildDescriptor()
130 _ = try? setter?.call(by: owner, withArguments: [value], appContext: appContext) in buildDescriptor()
137 …return try appContext.runtime.createSyncFunction(name, argsCount: 0) { [weak appContext, weak self… in buildDescriptor()
138 guard let appContext else { in buildDescriptor()
147 return try getter.call(by: this, withArguments: args, appContext: appContext) in buildDescriptor()
155 …return try appContext.runtime.createSyncFunction(name, argsCount: 1) { [weak appContext, weak self… in buildDescriptor()
156 guard let appContext else { in buildDescriptor()
165 return try setter.call(by: this, withArguments: args, appContext: appContext) in buildDescriptor()
173 let descriptor = try appContext.runtime.createObject() in buildDescriptor()
178 descriptor.setProperty("get", value: try buildGetter(appContext: appContext)) in buildDescriptor()
[all …]
H A DJavaScriptObjectBuilder.swift10 func decorate(object: JavaScriptObject, appContext: AppContext) throws in decorate()
20 func build(appContext: AppContext) throws -> JavaScriptObject in decorate()
28 func build(appContext: AppContext) throws -> JavaScriptObject { in build()
29 let object = try appContext.runtime.createObject() in build()
30 try decorate(object: object, appContext: appContext) in build()
34 func decorate(object: JavaScriptObject, appContext: AppContext) throws { in decorate()
/expo/ios/versioned/sdk49/ExpoModulesCore/ios/Swift/Objects/
H A DObjectDefinition.swift64 public func build(appContext: AppContext) throws -> JavaScriptObject { in build()
65 let object = try appContext.runtime.createObject() in build()
66 try decorate(object: object, appContext: appContext) in build()
70 public func decorate(object: JavaScriptObject, appContext: AppContext) throws { in decorate()
71 let runtime = try appContext.runtime in decorate()
74 try decorateWithFunctions(object: object, appContext: appContext) in decorate()
75 try decorateWithProperties(object: object, appContext: appContext) in decorate()
76 try decorateWithClasses(object: object, appContext: appContext) in decorate()
89 object.setProperty(fn.name, value: try fn.build(appContext: appContext)) in decorateWithFunctions()
95 let descriptor = try property.buildDescriptor(appContext: appContext) in decorateWithProperties()
[all …]
H A DPropertyComponent.swift124 let value = try getter?.call(by: owner, withArguments: [], appContext: appContext) in buildDescriptor()
130 _ = try? setter?.call(by: owner, withArguments: [value], appContext: appContext) in buildDescriptor()
137 …return try appContext.runtime.createSyncFunction(name, argsCount: 0) { [weak appContext, weak self… in buildDescriptor()
138 guard let appContext else { in buildDescriptor()
147 return try getter.call(by: this, withArguments: args, appContext: appContext) in buildDescriptor()
155 …return try appContext.runtime.createSyncFunction(name, argsCount: 1) { [weak appContext, weak self… in buildDescriptor()
156 guard let appContext else { in buildDescriptor()
165 return try setter.call(by: this, withArguments: args, appContext: appContext) in buildDescriptor()
173 let descriptor = try appContext.runtime.createObject() in buildDescriptor()
178 descriptor.setProperty("get", value: try buildGetter(appContext: appContext)) in buildDescriptor()
[all …]
H A DJavaScriptObjectBuilder.swift10 func decorate(object: JavaScriptObject, appContext: AppContext) throws in decorate()
20 func build(appContext: AppContext) throws -> JavaScriptObject in decorate()
28 func build(appContext: AppContext) throws -> JavaScriptObject { in build()
29 let object = try appContext.runtime.createObject() in build()
30 try decorate(object: object, appContext: appContext) in build()
34 func decorate(object: JavaScriptObject, appContext: AppContext) throws { in decorate()
/expo/packages/expo-modules-core/ios/Swift/Classes/
H A DClassComponent.swift40 public override func build(appContext: AppContext) throws -> JavaScriptObject { in build()
41 …let klass = try appContext.runtime.createClass(name) { [weak self, weak appContext] this, argument… in build()
42 guard let self = self, let appContext else { in build()
48 …et result = try? self.constructor?.call(by: this, withArguments: arguments, appContext: appContext) in build()
56 try decorate(object: klass, appContext: appContext) in build()
60appContext.classRegistry.register(nativeClassId: sharedObjectType.typeIdentifier, javaScriptClass:… in build()
66 public override func decorate(object: JavaScriptObject, appContext: AppContext) throws { in decorate()
72 try decorateWithFunctions(object: prototype, appContext: appContext) in decorate()
73 try decorateWithClasses(object: prototype, appContext: appContext) in decorate()
74 try decorateWithProperties(object: prototype, appContext: appContext) in decorate()
[all …]
/expo/ios/versioned/sdk49/ExpoModulesCore/ios/Swift/Classes/
H A DClassComponent.swift40 public override func build(appContext: AppContext) throws -> JavaScriptObject { in build()
41 …let klass = try appContext.runtime.createClass(name) { [weak self, weak appContext] this, argument… in build()
42 guard let self = self, let appContext else { in build()
48 …et result = try? self.constructor?.call(by: this, withArguments: arguments, appContext: appContext) in build()
56 try decorate(object: klass, appContext: appContext) in build()
60appContext.classRegistry.register(nativeClassId: sharedObjectType.typeIdentifier, javaScriptClass:… in build()
66 public override func decorate(object: JavaScriptObject, appContext: AppContext) throws { in decorate()
72 try decorateWithFunctions(object: prototype, appContext: appContext) in decorate()
73 try decorateWithClasses(object: prototype, appContext: appContext) in decorate()
74 try decorateWithProperties(object: prototype, appContext: appContext) in decorate()
[all …]
/expo/packages/expo-modules-core/ios/Swift/
H A DExpoBridgeModule.swift15 public let appContext: AppContext variable
23 self.init(appContext: AppContext())
26 public init(appContext: AppContext) {
27 self.appContext = appContext
47 appContext.reactBridge = bridge
50 guard let self = self, let bridge = self.appContext.reactBridge else {
65 guard let self = self, let bridge = self.appContext.reactBridge else {
84 appContext.legacyModuleRegistry = legacyModuleRegistry
85 appContext.legacyModulesProxy = legacyModulesProxy
89 appContext.useModulesProvider("ExpoModulesProvider")
[all …]
H A DModuleHolder.swift15 private(set) weak var appContext: AppContext? variable
47 self.appContext = appContext
65 guard let appContext else {
73 function.call(by: self, withArguments: args, appContext: appContext, callback: callback)
82 let arguments = try cast(arguments: args, forFunction: function, appContext: appContext) in callSync()
83 let result = try function.call(by: self, withArguments: arguments, appContext: appContext) in callSync()
105 guard let appContext else { in createJavaScriptModuleObject()
110 return try definition.build(appContext: appContext) in createJavaScriptModuleObject()
143 guard let appContext else { in modifyListenersCount()
147 definition.functions["startObserving"]?.call(withArguments: [], appContext: appContext) in modifyListenersCount()
[all …]
H A DJavaScriptFunction.swift15 private weak var appContext: AppContext? variable
17 init(rawFunction: RawJavaScriptFunction, appContext: AppContext) {
19 self.appContext = appContext
42 guard let appContext else { in call()
48 …guard let result = try dynamicType.cast(jsValue: value, appContext: appContext) as? ReturnType els… in call()
56 internal static func convert(from value: JavaScriptValue, appContext: AppContext) throws -> Self { in convert()
60 return Self(rawFunction: value.getFunction(), appContext: appContext) in convert()
/expo/ios/versioned/sdk49/ExpoModulesCore/ios/Swift/
H A DModuleHolder.swift15 private(set) weak var appContext: AppContext? variable
47 self.appContext = appContext
65 guard let appContext else {
73 function.call(by: self, withArguments: args, appContext: appContext, callback: callback)
82 let arguments = try cast(arguments: args, forFunction: function, appContext: appContext) in callSync()
83 let result = try function.call(by: self, withArguments: arguments, appContext: appContext) in callSync()
105 guard let appContext else { in createJavaScriptModuleObject()
110 return try definition.build(appContext: appContext) in createJavaScriptModuleObject()
143 guard let appContext else { in modifyListenersCount()
147 definition.functions["startObserving"]?.call(withArguments: [], appContext: appContext) in modifyListenersCount()
[all …]
H A DExpoBridgeModule.swift15 public let appContext: AppContext variable
23 appContext = AppContext()
43 appContext.reactBridge = bridge
46 guard let self = self, let bridge = self.appContext.reactBridge else {
49 self.appContext._runtime = ABI49_0_0EXJavaScriptRuntimeManager.runtime(fromBridge: bridge)
61 guard let self = self, let bridge = self.appContext.reactBridge else {
80 appContext.legacyModuleRegistry = legacyModuleRegistry
81 appContext.legacyModulesProxy = legacyModulesProxy
85 appContext.useModulesProvider("ABI49_0_0ExpoModulesProvider")
86 appContext.moduleRegistry.register(moduleType: NativeModulesProxyModule.self)
H A DJavaScriptFunction.swift15 private weak var appContext: AppContext? variable
17 init(rawFunction: RawJavaScriptFunction, appContext: AppContext) {
19 self.appContext = appContext
42 guard let appContext else { in call()
48 …guard let result = try dynamicType.cast(jsValue: value, appContext: appContext) as? ReturnType els… in call()
56 internal static func convert(from value: JavaScriptValue, appContext: AppContext) throws -> Self { in convert()
60 return Self(rawFunction: value.getFunction(), appContext: appContext) in convert()
/expo/ios/versioned/sdk48/ExpoModulesCore/ios/Swift/
H A DExpoBridgeModule.swift15 public let appContext: AppContext variable
23 appContext = AppContext()
43 appContext.reactBridge = bridge
46 guard let self = self, let bridge = self.appContext.reactBridge else {
49 self.appContext.runtime = ABI48_0_0EXJavaScriptRuntimeManager.runtime(fromBridge: bridge)
61 guard let self = self, let bridge = self.appContext.reactBridge else {
80 appContext.legacyModuleRegistry = legacyModuleRegistry
81 appContext.legacyModulesProxy = legacyModulesProxy
85 appContext.useModulesProvider("ABI48_0_0ExpoModulesProvider")
86 appContext.moduleRegistry.register(moduleType: NativeModulesProxyModule.self)

12345678910>>...23