nitrogen 0.2.23 → 0.29.4

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 (333) hide show
  1. package/README.md +15 -109
  2. package/lib/Logger.d.ts +10 -0
  3. package/lib/Logger.js +56 -0
  4. package/lib/autolinking/Autolinking.d.ts +8 -0
  5. package/lib/autolinking/Autolinking.js +1 -0
  6. package/lib/autolinking/android/createCMakeExtension.d.ts +6 -0
  7. package/lib/autolinking/android/createCMakeExtension.js +106 -0
  8. package/lib/autolinking/android/createGradleExtension.d.ts +5 -0
  9. package/lib/autolinking/android/createGradleExtension.js +36 -0
  10. package/lib/autolinking/android/createHybridObjectInitializer.d.ts +2 -0
  11. package/lib/autolinking/android/createHybridObjectInitializer.js +159 -0
  12. package/lib/autolinking/createAndroidAutolinking.d.ts +11 -0
  13. package/lib/autolinking/createAndroidAutolinking.js +13 -0
  14. package/lib/autolinking/createIOSAutolinking.d.ts +5 -0
  15. package/lib/autolinking/createIOSAutolinking.js +19 -0
  16. package/lib/autolinking/ios/createHybridObjectInitializer.d.ts +9 -0
  17. package/lib/autolinking/ios/createHybridObjectInitializer.js +97 -0
  18. package/lib/autolinking/ios/createPodspecRubyExtension.d.ts +5 -0
  19. package/lib/autolinking/ios/createPodspecRubyExtension.js +69 -0
  20. package/lib/autolinking/ios/createSwiftCxxBridge.d.ts +2 -0
  21. package/lib/autolinking/ios/createSwiftCxxBridge.js +117 -0
  22. package/lib/autolinking/ios/createSwiftUmbrellaHeader.d.ts +3 -0
  23. package/lib/autolinking/ios/createSwiftUmbrellaHeader.js +74 -0
  24. package/lib/config/NitroConfig.d.ts +52 -0
  25. package/lib/config/NitroConfig.js +112 -0
  26. package/lib/config/NitroUserConfig.d.ts +22 -0
  27. package/lib/config/NitroUserConfig.js +88 -0
  28. package/lib/config/getConfig.d.ts +2 -0
  29. package/lib/config/getConfig.js +84 -0
  30. package/lib/createGitAttributes.d.ts +1 -0
  31. package/lib/createGitAttributes.js +11 -0
  32. package/lib/createPlatformSpec.d.ts +4 -0
  33. package/lib/createPlatformSpec.js +127 -0
  34. package/lib/getFiles.d.ts +1 -0
  35. package/lib/getFiles.js +28 -0
  36. package/lib/getPlatformSpecs.d.ts +17 -0
  37. package/lib/getPlatformSpecs.js +153 -0
  38. package/lib/index.d.ts +2 -0
  39. package/lib/index.js +113 -10
  40. package/lib/init.d.ts +1 -0
  41. package/lib/init.js +123 -0
  42. package/lib/nitrogen.d.ts +11 -0
  43. package/lib/nitrogen.js +165 -0
  44. package/lib/prettifyDirectory.d.ts +1 -0
  45. package/lib/prettifyDirectory.js +27 -0
  46. package/lib/syntax/BridgedType.d.ts +41 -0
  47. package/lib/syntax/BridgedType.js +1 -0
  48. package/lib/syntax/CodeNode.d.ts +23 -0
  49. package/lib/syntax/CodeNode.js +1 -0
  50. package/lib/syntax/HybridObjectSpec.d.ts +13 -0
  51. package/lib/syntax/HybridObjectSpec.js +1 -0
  52. package/lib/syntax/Method.d.ts +41 -0
  53. package/lib/syntax/Method.js +108 -0
  54. package/lib/syntax/Parameter.d.ts +15 -0
  55. package/lib/syntax/Parameter.js +65 -0
  56. package/lib/syntax/Property.d.ts +50 -0
  57. package/lib/syntax/Property.js +147 -0
  58. package/lib/syntax/SourceFile.d.ts +70 -0
  59. package/lib/syntax/SourceFile.js +7 -0
  60. package/lib/syntax/c++/CppEnum.d.ts +6 -0
  61. package/lib/syntax/c++/CppEnum.js +110 -0
  62. package/lib/syntax/c++/CppHybridObject.d.ts +3 -0
  63. package/lib/syntax/c++/CppHybridObject.js +146 -0
  64. package/lib/syntax/c++/CppHybridObjectRegistration.d.ts +17 -0
  65. package/lib/syntax/c++/CppHybridObjectRegistration.js +18 -0
  66. package/lib/syntax/c++/CppStruct.d.ts +3 -0
  67. package/lib/syntax/c++/CppStruct.js +108 -0
  68. package/lib/syntax/c++/CppUnion.d.ts +6 -0
  69. package/lib/syntax/c++/CppUnion.js +88 -0
  70. package/lib/syntax/c++/getForwardDeclaration.d.ts +3 -0
  71. package/lib/syntax/c++/getForwardDeclaration.js +14 -0
  72. package/lib/syntax/c++/includeNitroHeader.d.ts +7 -0
  73. package/lib/syntax/c++/includeNitroHeader.js +34 -0
  74. package/lib/syntax/createType.d.ts +15 -0
  75. package/lib/syntax/createType.js +303 -0
  76. package/lib/syntax/getAllTypes.d.ts +3 -0
  77. package/lib/syntax/getAllTypes.js +11 -0
  78. package/lib/syntax/getCustomTypeConfig.d.ts +8 -0
  79. package/lib/syntax/getCustomTypeConfig.js +53 -0
  80. package/lib/syntax/getHybridObjectName.d.ts +36 -0
  81. package/lib/syntax/getHybridObjectName.js +10 -0
  82. package/lib/syntax/getInterfaceProperties.d.ts +4 -0
  83. package/lib/syntax/getInterfaceProperties.js +9 -0
  84. package/lib/syntax/getReferencedTypes.d.ts +2 -0
  85. package/lib/syntax/getReferencedTypes.js +47 -0
  86. package/lib/syntax/helpers.d.ts +13 -0
  87. package/lib/syntax/helpers.js +53 -0
  88. package/lib/syntax/isCoreType.d.ts +9 -0
  89. package/lib/syntax/isCoreType.js +47 -0
  90. package/lib/syntax/kotlin/FbjniHybridObject.d.ts +3 -0
  91. package/lib/syntax/kotlin/FbjniHybridObject.js +261 -0
  92. package/lib/syntax/kotlin/JNINativeRegistrations.d.ts +8 -0
  93. package/lib/syntax/kotlin/JNINativeRegistrations.js +7 -0
  94. package/lib/syntax/kotlin/KotlinBoxedPrimitive.d.ts +7 -0
  95. package/lib/syntax/kotlin/KotlinBoxedPrimitive.js +17 -0
  96. package/lib/syntax/kotlin/KotlinCxxBridgedType.d.ts +19 -0
  97. package/lib/syntax/kotlin/KotlinCxxBridgedType.js +893 -0
  98. package/lib/syntax/kotlin/KotlinEnum.d.ts +3 -0
  99. package/lib/syntax/kotlin/KotlinEnum.js +113 -0
  100. package/lib/syntax/kotlin/KotlinFunction.d.ts +3 -0
  101. package/lib/syntax/kotlin/KotlinFunction.js +256 -0
  102. package/lib/syntax/kotlin/KotlinHybridObject.d.ts +3 -0
  103. package/lib/syntax/kotlin/KotlinHybridObject.js +177 -0
  104. package/lib/syntax/kotlin/KotlinHybridObjectRegistration.d.ts +17 -0
  105. package/lib/syntax/kotlin/KotlinHybridObjectRegistration.js +26 -0
  106. package/lib/syntax/kotlin/KotlinStruct.d.ts +3 -0
  107. package/lib/syntax/kotlin/KotlinStruct.js +172 -0
  108. package/lib/syntax/kotlin/KotlinVariant.d.ts +3 -0
  109. package/lib/syntax/kotlin/KotlinVariant.js +191 -0
  110. package/lib/syntax/swift/SwiftCxxBridgedType.d.ts +21 -0
  111. package/lib/syntax/swift/SwiftCxxBridgedType.js +819 -0
  112. package/lib/syntax/swift/SwiftCxxTypeHelper.d.ts +17 -0
  113. package/lib/syntax/swift/SwiftCxxTypeHelper.js +613 -0
  114. package/lib/syntax/swift/SwiftEnum.d.ts +3 -0
  115. package/lib/syntax/swift/SwiftEnum.js +52 -0
  116. package/lib/syntax/swift/SwiftFunction.d.ts +3 -0
  117. package/lib/syntax/swift/SwiftFunction.js +83 -0
  118. package/lib/syntax/swift/SwiftHybridObject.d.ts +3 -0
  119. package/lib/syntax/swift/SwiftHybridObject.js +103 -0
  120. package/lib/syntax/swift/SwiftHybridObjectBridge.d.ts +11 -0
  121. package/lib/syntax/swift/SwiftHybridObjectBridge.js +451 -0
  122. package/lib/syntax/swift/SwiftHybridObjectRegistration.d.ts +19 -0
  123. package/lib/syntax/swift/SwiftHybridObjectRegistration.js +42 -0
  124. package/lib/syntax/swift/SwiftStruct.d.ts +3 -0
  125. package/lib/syntax/swift/SwiftStruct.js +75 -0
  126. package/lib/syntax/swift/SwiftVariant.d.ts +3 -0
  127. package/lib/syntax/swift/SwiftVariant.js +58 -0
  128. package/lib/syntax/types/ArrayBufferType.d.ts +10 -0
  129. package/lib/syntax/types/ArrayBufferType.js +37 -0
  130. package/lib/syntax/types/ArrayType.d.ts +12 -0
  131. package/lib/syntax/types/ArrayType.js +52 -0
  132. package/lib/syntax/types/BigIntType.d.ts +10 -0
  133. package/lib/syntax/types/BigIntType.js +27 -0
  134. package/lib/syntax/types/BooleanType.d.ts +10 -0
  135. package/lib/syntax/types/BooleanType.js +27 -0
  136. package/lib/syntax/types/CustomType.d.ts +14 -0
  137. package/lib/syntax/types/CustomType.js +36 -0
  138. package/lib/syntax/types/DateType.d.ts +10 -0
  139. package/lib/syntax/types/DateType.js +35 -0
  140. package/lib/syntax/types/EnumType.d.ts +23 -0
  141. package/lib/syntax/types/EnumType.js +101 -0
  142. package/lib/syntax/types/ErrorType.d.ts +11 -0
  143. package/lib/syntax/types/ErrorType.js +37 -0
  144. package/lib/syntax/types/FunctionType.d.ts +29 -0
  145. package/lib/syntax/types/FunctionType.js +147 -0
  146. package/lib/syntax/types/HybridObjectBaseType.d.ts +11 -0
  147. package/lib/syntax/types/HybridObjectBaseType.js +38 -0
  148. package/lib/syntax/types/HybridObjectType.d.ts +23 -0
  149. package/lib/syntax/types/HybridObjectType.js +131 -0
  150. package/lib/syntax/types/MapType.d.ts +10 -0
  151. package/lib/syntax/types/MapType.js +37 -0
  152. package/lib/syntax/types/NamedWrappingType.d.ts +14 -0
  153. package/lib/syntax/types/NamedWrappingType.js +27 -0
  154. package/lib/syntax/types/NullType.d.ts +10 -0
  155. package/lib/syntax/types/NullType.js +23 -0
  156. package/lib/syntax/types/NumberType.d.ts +10 -0
  157. package/lib/syntax/types/NumberType.js +27 -0
  158. package/lib/syntax/types/OptionalType.d.ts +13 -0
  159. package/lib/syntax/types/OptionalType.js +59 -0
  160. package/lib/syntax/types/PromiseType.d.ts +16 -0
  161. package/lib/syntax/types/PromiseType.js +62 -0
  162. package/lib/syntax/types/RecordType.d.ts +13 -0
  163. package/lib/syntax/types/RecordType.js +47 -0
  164. package/lib/syntax/types/ResultWrappingType.d.ts +13 -0
  165. package/lib/syntax/types/ResultWrappingType.js +44 -0
  166. package/lib/syntax/types/StringType.d.ts +10 -0
  167. package/lib/syntax/types/StringType.js +35 -0
  168. package/lib/syntax/types/StructType.d.ts +14 -0
  169. package/lib/syntax/types/StructType.js +61 -0
  170. package/lib/syntax/types/TupleType.d.ts +12 -0
  171. package/lib/syntax/types/TupleType.js +39 -0
  172. package/lib/syntax/types/Type.d.ts +55 -0
  173. package/lib/syntax/types/Type.js +1 -0
  174. package/lib/syntax/types/VariantType.d.ts +19 -0
  175. package/lib/syntax/types/VariantType.js +75 -0
  176. package/lib/syntax/types/VoidType.d.ts +10 -0
  177. package/lib/syntax/types/VoidType.js +27 -0
  178. package/lib/syntax/types/getTypeAs.d.ts +2 -0
  179. package/lib/syntax/types/getTypeAs.js +12 -0
  180. package/lib/utils.d.ts +22 -0
  181. package/lib/utils.js +126 -0
  182. package/lib/views/CppHybridViewComponent.d.ts +14 -0
  183. package/lib/views/CppHybridViewComponent.js +254 -0
  184. package/lib/views/createHostComponentJs.d.ts +3 -0
  185. package/lib/views/createHostComponentJs.js +27 -0
  186. package/lib/views/kotlin/KotlinHybridViewManager.d.ts +3 -0
  187. package/lib/views/kotlin/KotlinHybridViewManager.js +229 -0
  188. package/lib/views/swift/SwiftHybridViewManager.d.ts +3 -0
  189. package/lib/views/swift/SwiftHybridViewManager.js +131 -0
  190. package/lib/writeFile.d.ts +5 -0
  191. package/lib/writeFile.js +19 -0
  192. package/package.json +58 -29
  193. package/src/Logger.ts +63 -0
  194. package/src/autolinking/Autolinking.ts +9 -0
  195. package/src/autolinking/android/createCMakeExtension.ts +123 -0
  196. package/src/autolinking/android/createGradleExtension.ts +43 -0
  197. package/src/autolinking/android/createHybridObjectInitializer.ts +174 -0
  198. package/src/autolinking/createAndroidAutolinking.ts +28 -0
  199. package/src/autolinking/createIOSAutolinking.ts +24 -0
  200. package/src/autolinking/ios/createHybridObjectInitializer.ts +112 -0
  201. package/src/autolinking/ios/createPodspecRubyExtension.ts +76 -0
  202. package/src/autolinking/ios/createSwiftCxxBridge.ts +137 -0
  203. package/src/autolinking/ios/createSwiftUmbrellaHeader.ts +90 -0
  204. package/src/config/NitroConfig.ts +139 -0
  205. package/src/config/NitroUserConfig.ts +105 -0
  206. package/src/config/getConfig.ts +91 -0
  207. package/src/createGitAttributes.ts +15 -0
  208. package/src/createPlatformSpec.ts +176 -0
  209. package/src/getFiles.ts +31 -0
  210. package/src/getPlatformSpecs.ts +202 -0
  211. package/src/index.ts +146 -0
  212. package/src/init.ts +186 -0
  213. package/src/nitrogen.ts +246 -0
  214. package/src/prettifyDirectory.ts +32 -0
  215. package/src/syntax/BridgedType.ts +59 -0
  216. package/src/syntax/CodeNode.ts +24 -0
  217. package/src/syntax/HybridObjectSpec.ts +14 -0
  218. package/src/syntax/Method.ts +154 -0
  219. package/src/syntax/Parameter.ts +81 -0
  220. package/src/syntax/Property.ts +203 -0
  221. package/src/syntax/SourceFile.ts +80 -0
  222. package/src/syntax/c++/CppEnum.ts +128 -0
  223. package/src/syntax/c++/CppHybridObject.ts +165 -0
  224. package/src/syntax/c++/CppHybridObjectRegistration.ts +39 -0
  225. package/src/syntax/c++/CppStruct.ts +129 -0
  226. package/src/syntax/c++/CppUnion.ts +105 -0
  227. package/src/syntax/c++/getForwardDeclaration.ts +19 -0
  228. package/src/syntax/c++/includeNitroHeader.ts +40 -0
  229. package/src/syntax/createType.ts +365 -0
  230. package/src/syntax/getAllTypes.ts +18 -0
  231. package/src/syntax/getCustomTypeConfig.ts +71 -0
  232. package/src/syntax/getHybridObjectName.ts +48 -0
  233. package/src/syntax/getInterfaceProperties.ts +21 -0
  234. package/src/syntax/getReferencedTypes.ts +57 -0
  235. package/src/syntax/helpers.ts +79 -0
  236. package/src/syntax/isCoreType.ts +60 -0
  237. package/src/syntax/kotlin/FbjniHybridObject.ts +313 -0
  238. package/src/syntax/kotlin/JNINativeRegistrations.ts +19 -0
  239. package/src/syntax/kotlin/KotlinBoxedPrimitive.ts +19 -0
  240. package/src/syntax/kotlin/KotlinCxxBridgedType.ts +942 -0
  241. package/src/syntax/kotlin/KotlinEnum.ts +130 -0
  242. package/src/syntax/kotlin/KotlinFunction.ts +277 -0
  243. package/src/syntax/kotlin/KotlinHybridObject.ts +205 -0
  244. package/src/syntax/kotlin/KotlinHybridObjectRegistration.ts +51 -0
  245. package/src/syntax/kotlin/KotlinStruct.ts +198 -0
  246. package/src/syntax/kotlin/KotlinVariant.ts +212 -0
  247. package/src/syntax/swift/SwiftCxxBridgedType.ts +874 -0
  248. package/src/syntax/swift/SwiftCxxTypeHelper.ts +674 -0
  249. package/src/syntax/swift/SwiftEnum.ts +65 -0
  250. package/src/syntax/swift/SwiftFunction.ts +91 -0
  251. package/src/syntax/swift/SwiftHybridObject.ts +121 -0
  252. package/src/syntax/swift/SwiftHybridObjectBridge.ts +522 -0
  253. package/src/syntax/swift/SwiftHybridObjectRegistration.ts +75 -0
  254. package/src/syntax/swift/SwiftStruct.ts +85 -0
  255. package/src/syntax/swift/SwiftVariant.ts +67 -0
  256. package/src/syntax/types/ArrayBufferType.ts +49 -0
  257. package/src/syntax/types/ArrayType.ts +62 -0
  258. package/src/syntax/types/BigIntType.ts +35 -0
  259. package/src/syntax/types/BooleanType.ts +35 -0
  260. package/src/syntax/types/CustomType.ts +47 -0
  261. package/src/syntax/types/DateType.ts +43 -0
  262. package/src/syntax/types/EnumType.ts +130 -0
  263. package/src/syntax/types/ErrorType.ts +44 -0
  264. package/src/syntax/types/FunctionType.ts +167 -0
  265. package/src/syntax/types/HybridObjectBaseType.ts +54 -0
  266. package/src/syntax/types/HybridObjectType.ts +198 -0
  267. package/src/syntax/types/MapType.ts +49 -0
  268. package/src/syntax/types/NamedWrappingType.ts +33 -0
  269. package/src/syntax/types/NullType.ts +30 -0
  270. package/src/syntax/types/NumberType.ts +34 -0
  271. package/src/syntax/types/OptionalType.ts +66 -0
  272. package/src/syntax/types/PromiseType.ts +72 -0
  273. package/src/syntax/types/RecordType.ts +56 -0
  274. package/src/syntax/types/ResultWrappingType.ts +53 -0
  275. package/src/syntax/types/StringType.ts +44 -0
  276. package/src/syntax/types/StructType.ts +83 -0
  277. package/src/syntax/types/TupleType.ts +53 -0
  278. package/src/syntax/types/Type.ts +82 -0
  279. package/src/syntax/types/VariantType.ts +92 -0
  280. package/src/syntax/types/VoidType.ts +34 -0
  281. package/src/syntax/types/getTypeAs.ts +15 -0
  282. package/src/utils.ts +162 -0
  283. package/src/views/CppHybridViewComponent.ts +301 -0
  284. package/src/views/createHostComponentJs.ts +34 -0
  285. package/src/views/kotlin/KotlinHybridViewManager.ts +258 -0
  286. package/src/views/swift/SwiftHybridViewManager.ts +153 -0
  287. package/src/writeFile.ts +27 -0
  288. package/.jshintignore +0 -6
  289. package/.jshintrc +0 -3
  290. package/.npmignore +0 -3
  291. package/.travis.yml +0 -13
  292. package/LICENSE +0 -13
  293. package/browser/nitrogen-min.js +0 -3
  294. package/browser/nitrogen.js +0 -6369
  295. package/lib/apiKey.js +0 -67
  296. package/lib/blob.js +0 -57
  297. package/lib/commandManager.js +0 -350
  298. package/lib/device.js +0 -19
  299. package/lib/memoryStore.js +0 -24
  300. package/lib/message.js +0 -298
  301. package/lib/permission.js +0 -121
  302. package/lib/principal.js +0 -330
  303. package/lib/service.js +0 -349
  304. package/lib/session.js +0 -494
  305. package/lib/user.js +0 -20
  306. package/publish +0 -2
  307. package/scripts/build-documentation +0 -4
  308. package/scripts/build-module +0 -27
  309. package/scripts/module.js +0 -12
  310. package/scripts/postamble.js +0 -1
  311. package/scripts/preamble.js +0 -2
  312. package/scripts/run-test-server +0 -9
  313. package/test/config.js +0 -12
  314. package/test/fixtures/images/image.jpg +0 -0
  315. package/test/fixtures/images/motion0.jpg +0 -0
  316. package/test/fixtures/images/motion1.jpg +0 -0
  317. package/test/fixtures/images/motion2.jpg +0 -0
  318. package/test/fixtures/index.js +0 -76
  319. package/test/main.js +0 -5
  320. package/test/memoryStore.js +0 -22
  321. package/test/mocha.opts +0 -3
  322. package/test/units/apiKey.js +0 -46
  323. package/test/units/blob.js +0 -35
  324. package/test/units/commandManager.js +0 -67
  325. package/test/units/device.js +0 -26
  326. package/test/units/heartbeat.js +0 -28
  327. package/test/units/message.js +0 -79
  328. package/test/units/permissions.js +0 -43
  329. package/test/units/principal.js +0 -116
  330. package/test/units/service.js +0 -92
  331. package/test/units/session.js +0 -97
  332. package/test/units/user.js +0 -48
  333. package/yuidoc.json +0 -8
package/README.md CHANGED
@@ -1,118 +1,24 @@
1
- # Nitrogen Client
1
+ <a href="https://margelo.com">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="../../docs/static/img/banner-nitrogen-dark.png" />
4
+ <source media="(prefers-color-scheme: light)" srcset="../../docs/static/img/banner-nitrogen-light.png" />
5
+ <img alt="Nitrogen" src="../../docs/static/img/banner-nitrogen-light.png" />
6
+ </picture>
7
+ </a>
2
8
 
3
- Nitrogen is a platform for building connected devices. Nitrogen provides the authentication, authorization, and real time message passing framework so that you can focus on your device and application. All with a consistent development platform that leverages the ubiquity of Javascript.
9
+ <br />
4
10
 
5
- This is the client library for developing applications and devices that communicate to the Nitrogen service.
11
+ **Nitrogen** is a code-generator that takes TypeScript interfaces and generates C++, Swift and Kotlin code and native bindings built on top of the [**react-native-nitro-modules**](../react-native-nitro-modules/) core APIs.
6
12
 
7
- ## Device Development Model
13
+ ## Installation
8
14
 
9
- Nitrogen at its heart uses messaging between principals (devices and users). Principals in the system can create and consume messages. Messages can follow a well known schema to enable interoperability between applications or use their own private custom message types.
10
-
11
- For example, a thermometer that measures temperature once every 15 minutes could be implemented in Nitrogen like this:
12
-
13
- ``` javascript
14
- var thermometer = new nitrogen.Device({
15
- tags: ['sends:temperature'],
16
- nickname: 'thermometer'
17
- });
18
-
19
- var service = new nitrogen.Service(config);
20
- service.connect(thermometer, function(err, session, thermometer) {
21
-
22
- // take temperature every 15 minutes.
23
-
24
- setInterval(function() {
25
- var message = new Nitrogen.Message({
26
- type: 'temperature',
27
- body: {
28
- temperature: getTemp()
29
- }
30
- });
31
-
32
- message.save(session);
33
- }, 15 * 60 * 1000);
34
-
35
- });
36
- ```
37
-
38
- You can find a complete example for a device application of Nitrogen in the [camera](https://github.com/nitrogenjs/camera) project.
39
-
40
- ## Listening to a device's message stream
41
-
42
- An application that displays these temperatures in real time as they are received would look like this. In this case,
43
- we're using a user principal, and a filter with onMessage to only notify us of temperature updates.
44
-
45
- ``` javascript
46
- var user = new nitrogen.User({...});
47
-
48
- var service = new nitrogen.Service(config);
49
- service.connect(user, function(err, session, user) {
50
- session.onMessage({ type: 'temperature' }, function(message) {
51
- console.log("The temperature is now: " + message.body.temperature);
52
-
53
- // update the UI
54
- });
55
- });
15
+ Install [nitrogen](https://npmjs.org/nitrogen) as a `devDependency` in your react-native library:
16
+ ```sh
17
+ npm i nitrogen -D
56
18
  ```
57
19
 
58
- ## Getting Started
59
-
60
- To get started with a Nitrogen client:
61
-
62
- ### Node.js application
63
-
64
- 1. `npm install nitrogen`
65
-
66
- ### Browser application
67
-
68
- 1. Add `<script src="https://api.nitrogen.io/client/nitrogen-min.js" />` to your application.
69
-
70
- ### Documentation
71
-
72
- Documentation for the Nitrogen client library can be found online at the [Nitrogen project](http://nitrogen.io).
73
-
74
- ### Contributing to the project.
75
-
76
- 1. Clone or fork this repo: `https://github.com/nitrogenjs/client`
77
- 2. If you are building on Windows, make sure to fetch all of the node-gyp dependencies as explained here: https://github.com/TooTallNate/node-gyp#installation
78
- 2. Fetch and install its node.js dependencies: `npm install`
79
- 3. Run a [Nitrogen server](https://github.com/nitrogenjs/service) locally that the tests can run against in test mode (NODE_ENV=test).
80
- 4. Run the tests to make sure everything is setup correctly: `npm test`
81
- 5. Make your change as a clean commit for a pull request.
82
- 6. Make sure there is a test to cover new functionality so nobody can break it in the future without us knowing.
83
- 7. Submit it as a pull request to the project.
84
-
85
- ## How to contribute
86
-
87
- 1. Feedback: We'd love feedback on what problems you are using Nitrogen to solve. Obviously, we'd also like to hear about where you ran into sharp edges and dead ends. Drop me a message at timfpark@gmail.com or file an issue with us above.
88
- 2. Pull requests: If you'd like to tackle an issue, fork the repo, create a clean commit for the fix or enhancement with tests if necessary, and send us a pull request. This is also the path to becoming a core committer for the project for folks that are interested in contributing in more depth.
89
- 3. Documentation: Better technical documentation is key to broadening the use of the platform. We'd love to have more help and this is one of the most valuable contributions you can make.
90
-
91
- ## Running on Windows
92
-
93
- On Windows, you'll need to install some dependencies first:
94
- - [node-gyp](https://github.com/TooTallNate/node-gyp/) (`npm install -g node-gyp`)
95
- - [Python 2.7](http://www.python.org/download/releases/2.7.3#download) (not 3.3)
96
- - Visual Studio 2010 or higher (including Express editions)
97
- - Windows XP/Vista/7:
98
- - Microsoft Visual Studio C++ 2010 ([Express](http://go.microsoft.com/?linkid=9709949) version works well)
99
- - Also install [Microsoft Visual Studio 2010 Service Pack 1](http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=23691)
100
- - For 64-bit builds of node and native modules you will _**also**_ need the [Windows 7 64-bit SDK](http://www.microsoft.com/en-us/download/details.aspx?id=8279)
101
- - If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1](http://www.microsoft.com/en-us/download/details.aspx?id=4422)
102
- - Windows 8:
103
- - Microsoft Visual Studio C++ 2012 for Windows Desktop ([Express](http://go.microsoft.com/?linkid=9816758) version works well)
104
- - [OpenSSL](http://slproweb.com/products/Win32OpenSSL.html) (normal, not light)
105
- in the same bitness as your Node.js installation.
106
- - The build script looks for OpenSSL in the default install directory (`C:\OpenSSL-Win32` or `C:\OpenSSL-Win64`)
107
- - If you get `Error: The specified module could not be found.`, copy `libeay32.dll` from the OpenSSL bin directory to this module's bin directory, or to Windows\System3.
108
20
 
109
- ## Nitrogen Project
110
21
 
111
- The Nitrogen project is housed in a set of GitHub projects:
22
+ ## Usage
112
23
 
113
- 1. [service](https://github.com/nitrogenjs/service): Core platform responsible for managing principals, security, and messaging.
114
- 2. [client](https://github.com/nitrogenjs/client): JavaScript client library for building Nitrogen devices and applications.
115
- 3. [admin](https://github.com/nitrogenjs/admin): Administrative tool for managing the Nitrogen service.
116
- 4. [device](https://github.com/nitrogenjs/devices): Adaptors for common pieces of hardware.
117
- 5. [commands](https://github.com/nitrogenjs/commands): CommandManagers and schemas for well known command types.
118
- 6. [cli](https://github.com/nitrogenjs/cli): Command line interface for working with a Nitrogen service.
24
+ See the [Nitrogen documentation](https://nitro.margelo.com/docs/nitrogen) for more information.
@@ -0,0 +1,10 @@
1
+ export type LogLevel = 'debug' | 'info' | 'warning' | 'error';
2
+ export declare function isValidLogLevel(level: unknown): level is LogLevel;
3
+ export declare function setLogLevel(level: LogLevel): void;
4
+ export declare const Logger: {
5
+ withIndented(callback: () => void): void;
6
+ debug(message: string, ...extra: unknown[]): void;
7
+ info(message: string, ...extra: unknown[]): void;
8
+ warn(message: string, ...extra: unknown[]): void;
9
+ error(message: string, ...extra: unknown[]): void;
10
+ };
package/lib/Logger.js ADDED
@@ -0,0 +1,56 @@
1
+ const levelMap = {
2
+ debug: 0,
3
+ info: 1,
4
+ warning: 2,
5
+ error: 3,
6
+ };
7
+ let currentLogLevel = 'info';
8
+ export function isValidLogLevel(level) {
9
+ // @ts-expect-error
10
+ return typeof levelMap[level] === 'number';
11
+ }
12
+ export function setLogLevel(level) {
13
+ currentLogLevel = level;
14
+ }
15
+ function isAtLeast(level) {
16
+ return levelMap[level] >= levelMap[currentLogLevel];
17
+ }
18
+ let indentation = 0;
19
+ function getIndentation() {
20
+ let string = '';
21
+ for (let i = 0; i < indentation; i++) {
22
+ string += ' ';
23
+ }
24
+ return string;
25
+ }
26
+ export const Logger = {
27
+ withIndented(callback) {
28
+ try {
29
+ indentation++;
30
+ callback();
31
+ }
32
+ finally {
33
+ indentation--;
34
+ }
35
+ },
36
+ debug(message, ...extra) {
37
+ if (isAtLeast('debug')) {
38
+ console.debug(getIndentation() + message, ...extra);
39
+ }
40
+ },
41
+ info(message, ...extra) {
42
+ if (isAtLeast('info')) {
43
+ console.info(getIndentation() + message, ...extra);
44
+ }
45
+ },
46
+ warn(message, ...extra) {
47
+ if (isAtLeast('warning')) {
48
+ console.warn(getIndentation() + message, ...extra);
49
+ }
50
+ },
51
+ error(message, ...extra) {
52
+ if (isAtLeast('error')) {
53
+ console.error(getIndentation() + message, ...extra);
54
+ }
55
+ },
56
+ };
@@ -0,0 +1,8 @@
1
+ import type { Platform } from '../getPlatformSpecs.js';
2
+ import type { SourceFile } from '../syntax/SourceFile.js';
3
+ type AutolinkingFile = Omit<SourceFile, 'language'>;
4
+ export interface Autolinking {
5
+ platform: Platform;
6
+ sourceFiles: AutolinkingFile[];
7
+ }
8
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { SourceFile } from '../../syntax/SourceFile.js';
2
+ export interface CMakeFile extends Omit<SourceFile, 'language'> {
3
+ language: 'cmake';
4
+ }
5
+ export declare function getBuildingWithGeneratedCmakeDefinition(): string;
6
+ export declare function createCMakeExtension(files: SourceFile[]): CMakeFile;
@@ -0,0 +1,106 @@
1
+ import { NitroConfig } from '../../config/NitroConfig.js';
2
+ import { indent, toLowerCamelCase, toUnixPath } from '../../utils.js';
3
+ import { createFileMetadataString, getRelativeDirectory, getRelativeDirectoryGenerated, isCppFile, isNotDuplicate, } from '../../syntax/helpers.js';
4
+ export function getBuildingWithGeneratedCmakeDefinition() {
5
+ const moduleName = NitroConfig.current.getAndroidCxxLibName();
6
+ const upper = toLowerCamelCase(moduleName).toUpperCase();
7
+ return `BUILDING_${upper}_WITH_GENERATED_CMAKE_PROJECT`;
8
+ }
9
+ export function createCMakeExtension(files) {
10
+ const name = NitroConfig.current.getAndroidCxxLibName();
11
+ const sharedFiles = files
12
+ .filter((f) => f.platform === 'shared' && isCppFile(f))
13
+ .map((f) => getRelativeDirectory(f))
14
+ .map((p) => toUnixPath(p))
15
+ .filter(isNotDuplicate);
16
+ const androidFiles = files
17
+ .filter((f) => f.platform === 'android' && isCppFile(f))
18
+ .map((f) => getRelativeDirectory(f))
19
+ .map((p) => toUnixPath(p))
20
+ .filter(isNotDuplicate);
21
+ const autolinkingFilePath = getRelativeDirectoryGenerated('android', `${name}OnLoad.cpp`);
22
+ const autolinkingFile = toUnixPath(autolinkingFilePath);
23
+ const buildingWithDefinition = getBuildingWithGeneratedCmakeDefinition();
24
+ const code = `
25
+ ${createFileMetadataString(`${name}+autolinking.cmake`, '#')}
26
+
27
+ # This is a CMake file that adds all files generated by Nitrogen
28
+ # to the current CMake project.
29
+ #
30
+ # To use it, add this to your CMakeLists.txt:
31
+ # \`\`\`cmake
32
+ # include(\${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/${name}+autolinking.cmake)
33
+ # \`\`\`
34
+
35
+ # Add all headers that were generated by Nitrogen
36
+ include_directories(
37
+ "../nitrogen/generated/shared/c++"
38
+ "../nitrogen/generated/android/c++"
39
+ "../nitrogen/generated/android/"
40
+ )
41
+
42
+ # Add all .cpp sources that were generated by Nitrogen
43
+ target_sources(
44
+ # CMake project name (Android C++ library name)
45
+ ${name} PRIVATE
46
+ # Autolinking Setup
47
+ ${autolinkingFile}
48
+ # Shared Nitrogen C++ sources
49
+ ${indent(sharedFiles.join('\n'), ' ')}
50
+ # Android-specific Nitrogen C++ sources
51
+ ${indent(androidFiles.join('\n'), ' ')}
52
+ )
53
+
54
+ # Define a flag to check if we are building properly
55
+ add_definitions(-D${buildingWithDefinition})
56
+
57
+ # From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
58
+ # Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake
59
+ target_compile_definitions(
60
+ ${name} PRIVATE
61
+ -DFOLLY_NO_CONFIG=1
62
+ -DFOLLY_HAVE_CLOCK_GETTIME=1
63
+ -DFOLLY_USE_LIBCPP=1
64
+ -DFOLLY_CFG_NO_COROUTINES=1
65
+ -DFOLLY_MOBILE=1
66
+ -DFOLLY_HAVE_RECVMMSG=1
67
+ -DFOLLY_HAVE_PTHREAD=1
68
+ # Once we target android-23 above, we can comment
69
+ # the following line. NDK uses GNU style stderror_r() after API 23.
70
+ -DFOLLY_HAVE_XSI_STRERROR_R=1
71
+ )
72
+
73
+ # Add all libraries required by the generated specs
74
+ find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++
75
+ find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule)
76
+ find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library
77
+
78
+ # Link all libraries together
79
+ target_link_libraries(
80
+ ${name}
81
+ fbjni::fbjni # <-- Facebook C++ JNI helpers
82
+ ReactAndroid::jsi # <-- RN: JSI
83
+ react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
84
+ )
85
+
86
+ # Link react-native (different prefab between RN 0.75 and RN 0.76)
87
+ if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
88
+ target_link_libraries(
89
+ ${name}
90
+ ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
91
+ )
92
+ else()
93
+ target_link_libraries(
94
+ ${name}
95
+ ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
96
+ )
97
+ endif()
98
+ `.trim();
99
+ return {
100
+ content: code,
101
+ language: 'cmake',
102
+ name: `${name}+autolinking.cmake`,
103
+ platform: 'android',
104
+ subdirectory: [],
105
+ };
106
+ }
@@ -0,0 +1,5 @@
1
+ import type { SourceFile } from '../../syntax/SourceFile.js';
2
+ export interface GradleFile extends Omit<SourceFile, 'language'> {
3
+ language: 'gradle';
4
+ }
5
+ export declare function createGradleExtension(): GradleFile;
@@ -0,0 +1,36 @@
1
+ import { NitroConfig } from '../../config/NitroConfig.js';
2
+ import { createFileMetadataString } from '../../syntax/helpers.js';
3
+ export function createGradleExtension() {
4
+ const name = NitroConfig.current.getAndroidCxxLibName();
5
+ const code = `
6
+ ${createFileMetadataString(`${name}+autolinking.gradle`)}
7
+
8
+ /// This is a Gradle file that adds all files generated by Nitrogen
9
+ /// to the current Gradle project.
10
+ ///
11
+ /// To use it, add this to your build.gradle:
12
+ /// \`\`\`gradle
13
+ /// apply from: '../nitrogen/generated/android/${name}+autolinking.gradle'
14
+ /// \`\`\`
15
+
16
+ logger.warn("[NitroModules] 🔥 ${name} is boosted by nitro!")
17
+
18
+ android {
19
+ sourceSets {
20
+ main {
21
+ java.srcDirs += [
22
+ // Nitrogen files
23
+ "\${project.projectDir}/../nitrogen/generated/android/kotlin"
24
+ ]
25
+ }
26
+ }
27
+ }
28
+ `.trim();
29
+ return {
30
+ content: code,
31
+ language: 'gradle',
32
+ name: `${name}+autolinking.gradle`,
33
+ platform: 'android',
34
+ subdirectory: [],
35
+ };
36
+ }
@@ -0,0 +1,2 @@
1
+ import type { SourceFile } from '../../syntax/SourceFile.js';
2
+ export declare function createHybridObjectIntializer(): SourceFile[];
@@ -0,0 +1,159 @@
1
+ import { NitroConfig } from '../../config/NitroConfig.js';
2
+ import { createCppHybridObjectRegistration } from '../../syntax/c++/CppHybridObjectRegistration.js';
3
+ import { includeHeader } from '../../syntax/c++/includeNitroHeader.js';
4
+ import { createFileMetadataString, isNotDuplicate, } from '../../syntax/helpers.js';
5
+ import { getJNINativeRegistrations } from '../../syntax/kotlin/JNINativeRegistrations.js';
6
+ import { createJNIHybridObjectRegistration } from '../../syntax/kotlin/KotlinHybridObjectRegistration.js';
7
+ import { indent } from '../../utils.js';
8
+ import { getBuildingWithGeneratedCmakeDefinition } from './createCMakeExtension.js';
9
+ export function createHybridObjectIntializer() {
10
+ const cxxNamespace = NitroConfig.current.getCxxNamespace('c++');
11
+ const cppLibName = NitroConfig.current.getAndroidCxxLibName();
12
+ const javaNamespace = NitroConfig.current.getAndroidPackage('java/kotlin');
13
+ const autolinkingClassName = `${NitroConfig.current.getAndroidCxxLibName()}OnLoad`;
14
+ const jniRegistrations = getJNINativeRegistrations()
15
+ .map((r) => `${r.namespace}::${r.className}::registerNatives();`)
16
+ .filter(isNotDuplicate);
17
+ const autolinkedHybridObjects = NitroConfig.current.getAutolinkedHybridObjects();
18
+ const cppHybridObjectImports = [];
19
+ const cppRegistrations = [];
20
+ for (const hybridObjectName of Object.keys(autolinkedHybridObjects)) {
21
+ const config = autolinkedHybridObjects[hybridObjectName];
22
+ if (config?.cpp != null) {
23
+ // Autolink a C++ HybridObject!
24
+ const { cppCode, requiredImports } = createCppHybridObjectRegistration({
25
+ hybridObjectName: hybridObjectName,
26
+ cppClassName: config.cpp,
27
+ });
28
+ cppHybridObjectImports.push(...requiredImports);
29
+ cppRegistrations.push(cppCode);
30
+ }
31
+ if (config?.kotlin != null) {
32
+ // Autolink a Kotlin HybridObject through JNI/C++!
33
+ const { cppCode, requiredImports } = createJNIHybridObjectRegistration({
34
+ hybridObjectName: hybridObjectName,
35
+ jniClassName: config.kotlin,
36
+ });
37
+ cppHybridObjectImports.push(...requiredImports);
38
+ cppRegistrations.push(cppCode);
39
+ }
40
+ }
41
+ const buildingWithDefinition = getBuildingWithGeneratedCmakeDefinition();
42
+ const includes = [
43
+ ...getJNINativeRegistrations().map((r) => includeHeader(r.import)),
44
+ ...cppHybridObjectImports.map((i) => includeHeader(i)),
45
+ ]
46
+ .filter(isNotDuplicate)
47
+ .join('\n');
48
+ const hppCode = `
49
+ ${createFileMetadataString(`${autolinkingClassName}.hpp`)}
50
+
51
+ #include <jni.h>
52
+ #include <NitroModules/NitroDefines.hpp>
53
+
54
+ namespace ${cxxNamespace} {
55
+
56
+ /**
57
+ * Initializes the native (C++) part of ${cppLibName}, and autolinks all Hybrid Objects.
58
+ * Call this in your \`JNI_OnLoad\` function (probably inside \`cpp-adapter.cpp\`).
59
+ * Example:
60
+ * \`\`\`cpp (cpp-adapter.cpp)
61
+ * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
62
+ * return ${cxxNamespace}::initialize(vm);
63
+ * }
64
+ * \`\`\`
65
+ */
66
+ int initialize(JavaVM* vm);
67
+
68
+ } // namespace ${cxxNamespace}
69
+
70
+ `;
71
+ const cppCode = `
72
+ ${createFileMetadataString(`${autolinkingClassName}.cpp`)}
73
+
74
+ #ifndef ${buildingWithDefinition}
75
+ #error ${autolinkingClassName}.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
76
+ #endif
77
+
78
+ #include "${autolinkingClassName}.hpp"
79
+
80
+ #include <jni.h>
81
+ #include <fbjni/fbjni.h>
82
+ #include <NitroModules/HybridObjectRegistry.hpp>
83
+
84
+ ${includes}
85
+
86
+ namespace ${cxxNamespace} {
87
+
88
+ int initialize(JavaVM* vm) {
89
+ using namespace margelo::nitro;
90
+ using namespace ${cxxNamespace};
91
+ using namespace facebook;
92
+
93
+ return facebook::jni::initialize(vm, [] {
94
+ // Register native JNI methods
95
+ ${indent(jniRegistrations.join('\n'), ' ')}
96
+
97
+ // Register Nitro Hybrid Objects
98
+ ${indent(cppRegistrations.join('\n'), ' ')}
99
+ });
100
+ }
101
+
102
+ } // namespace ${cxxNamespace}
103
+ `.trim();
104
+ const kotlinCode = `
105
+ ${createFileMetadataString(`${autolinkingClassName}.kt`)}
106
+
107
+ package ${javaNamespace}
108
+
109
+ import android.util.Log
110
+
111
+ internal class ${autolinkingClassName} {
112
+ companion object {
113
+ private const val TAG = "${autolinkingClassName}"
114
+ private var didLoad = false
115
+ /**
116
+ * Initializes the native part of "${cppLibName}".
117
+ * This method is idempotent and can be called more than once.
118
+ */
119
+ @JvmStatic
120
+ fun initializeNative() {
121
+ if (didLoad) return
122
+ try {
123
+ Log.i(TAG, "Loading ${cppLibName} C++ library...")
124
+ System.loadLibrary("${cppLibName}")
125
+ Log.i(TAG, "Successfully loaded ${cppLibName} C++ library!")
126
+ didLoad = true
127
+ } catch (e: Error) {
128
+ Log.e(TAG, "Failed to load ${cppLibName} C++ library! Is it properly installed and linked? " +
129
+ "Is the name correct? (see \`CMakeLists.txt\`, at \`add_library(...)\`)", e)
130
+ throw e
131
+ }
132
+ }
133
+ }
134
+ }
135
+ `.trim();
136
+ return [
137
+ {
138
+ content: hppCode,
139
+ language: 'c++',
140
+ name: `${autolinkingClassName}.hpp`,
141
+ platform: 'android',
142
+ subdirectory: [],
143
+ },
144
+ {
145
+ content: cppCode,
146
+ language: 'c++',
147
+ name: `${autolinkingClassName}.cpp`,
148
+ platform: 'android',
149
+ subdirectory: [],
150
+ },
151
+ {
152
+ content: kotlinCode,
153
+ language: 'kotlin',
154
+ name: `${autolinkingClassName}.kt`,
155
+ platform: 'android',
156
+ subdirectory: ['kotlin', ...javaNamespace.split('.')],
157
+ },
158
+ ];
159
+ }
@@ -0,0 +1,11 @@
1
+ import type { SourceFile, SourceImport } from '../syntax/SourceFile.js';
2
+ import type { Autolinking } from './Autolinking.js';
3
+ interface JNIHybridRegistration {
4
+ sourceImport: SourceImport;
5
+ registrationCode: string;
6
+ }
7
+ interface AndroidAutolinking extends Autolinking {
8
+ jniHybridRegistrations: JNIHybridRegistration[];
9
+ }
10
+ export declare function createAndroidAutolinking(allFiles: SourceFile[]): AndroidAutolinking;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ import { createCMakeExtension } from './android/createCMakeExtension.js';
2
+ import { createGradleExtension } from './android/createGradleExtension.js';
3
+ import { createHybridObjectIntializer } from './android/createHybridObjectInitializer.js';
4
+ export function createAndroidAutolinking(allFiles) {
5
+ const cmakeExtension = createCMakeExtension(allFiles);
6
+ const gradleExtension = createGradleExtension();
7
+ const hybridObjectInitializer = createHybridObjectIntializer();
8
+ return {
9
+ platform: 'android',
10
+ jniHybridRegistrations: [],
11
+ sourceFiles: [cmakeExtension, gradleExtension, ...hybridObjectInitializer],
12
+ };
13
+ }
@@ -0,0 +1,5 @@
1
+ import type { Autolinking } from './Autolinking.js';
2
+ interface IOSAutolinking extends Autolinking {
3
+ }
4
+ export declare function createIOSAutolinking(): IOSAutolinking;
5
+ export {};
@@ -0,0 +1,19 @@
1
+ import { createHybridObjectIntializer } from './ios/createHybridObjectInitializer.js';
2
+ import { createPodspecRubyExtension } from './ios/createPodspecRubyExtension.js';
3
+ import { createSwiftCxxBridge } from './ios/createSwiftCxxBridge.js';
4
+ import { createSwiftUmbrellaHeader } from './ios/createSwiftUmbrellaHeader.js';
5
+ export function createIOSAutolinking() {
6
+ const podspecExtension = createPodspecRubyExtension();
7
+ const swiftCxxBridge = createSwiftCxxBridge();
8
+ const swiftUmbrellaHeader = createSwiftUmbrellaHeader();
9
+ const hybridObjectInitializer = createHybridObjectIntializer();
10
+ return {
11
+ platform: 'ios',
12
+ sourceFiles: [
13
+ podspecExtension,
14
+ ...swiftCxxBridge,
15
+ swiftUmbrellaHeader,
16
+ ...hybridObjectInitializer,
17
+ ],
18
+ };
19
+ }
@@ -0,0 +1,9 @@
1
+ import type { SourceFile } from '../../syntax/SourceFile.js';
2
+ type ObjcFile = Omit<SourceFile, 'language'> & {
3
+ language: 'objective-c++';
4
+ };
5
+ type SwiftFile = Omit<SourceFile, 'language'> & {
6
+ language: 'swift';
7
+ };
8
+ export declare function createHybridObjectIntializer(): [ObjcFile, SwiftFile] | [];
9
+ export {};