@pigeonmal/react-native-nitro-fetch 0.1.9 → 0.2.1

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 (89) hide show
  1. package/NitroFetch.podspec +30 -30
  2. package/android/CMakeLists.txt +70 -70
  3. package/android/build.gradle +128 -129
  4. package/android/cronet-release/build.gradle +2 -0
  5. package/android/cronet-release/cronet-release.aar +0 -0
  6. package/android/gradle.properties +5 -5
  7. package/android/src/main/AndroidManifest.xml +2 -2
  8. package/android/src/main/cpp/cpp-adapter.cpp +6 -6
  9. package/android/src/main/java/com/margelo/nitro/nitrofetch/AutoPrefetcher.kt +72 -72
  10. package/android/src/main/java/com/margelo/nitro/nitrofetch/FetchCache.kt +57 -57
  11. package/android/src/main/java/com/margelo/nitro/nitrofetch/NativeStorage.kt +102 -102
  12. package/android/src/main/java/com/margelo/nitro/nitrofetch/NitroFetch.kt +95 -95
  13. package/android/src/main/java/com/margelo/nitro/nitrofetch/NitroFetchClient.kt +317 -317
  14. package/android/src/main/java/com/margelo/nitro/nitrofetch/NitroFetchPackage.kt +22 -22
  15. package/ios/FetchCache.swift +56 -56
  16. package/ios/NativeStorage.swift +61 -61
  17. package/ios/NitroAutoPrefetcher.swift +45 -45
  18. package/ios/NitroBootstrap.mm +27 -27
  19. package/ios/NitroFetch.swift +9 -9
  20. package/ios/NitroFetchClient.swift +230 -230
  21. package/lib/module/NitroFetch.nitro.js.map +1 -1
  22. package/lib/module/NitroInstances.js.map +1 -1
  23. package/lib/module/fetch.js.map +1 -1
  24. package/lib/module/index.js.map +1 -1
  25. package/lib/module/type.js.map +1 -1
  26. package/nitro.json +25 -25
  27. package/nitrogen/generated/android/c++/JHybridNativeStorageSpec.cpp +1 -1
  28. package/nitrogen/generated/android/c++/JHybridNativeStorageSpec.hpp +1 -1
  29. package/nitrogen/generated/android/c++/JHybridNitroFetchClientSpec.cpp +1 -1
  30. package/nitrogen/generated/android/c++/JHybridNitroFetchClientSpec.hpp +1 -1
  31. package/nitrogen/generated/android/c++/JHybridNitroFetchSpec.cpp +1 -1
  32. package/nitrogen/generated/android/c++/JHybridNitroFetchSpec.hpp +1 -1
  33. package/nitrogen/generated/android/c++/JNitroHeader.hpp +1 -1
  34. package/nitrogen/generated/android/c++/JNitroRequest.hpp +1 -1
  35. package/nitrogen/generated/android/c++/JNitroRequestMethod.hpp +1 -1
  36. package/nitrogen/generated/android/c++/JNitroResponse.hpp +1 -1
  37. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrofetch/HybridNativeStorageSpec.kt +1 -1
  38. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrofetch/HybridNitroFetchClientSpec.kt +1 -1
  39. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrofetch/HybridNitroFetchSpec.kt +1 -1
  40. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrofetch/NitroHeader.kt +1 -1
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrofetch/NitroRequest.kt +1 -1
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrofetch/NitroRequestMethod.kt +1 -1
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrofetch/NitroResponse.kt +1 -1
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrofetch/nitrofetchOnLoad.kt +1 -1
  45. package/nitrogen/generated/android/nitrofetch+autolinking.cmake +1 -1
  46. package/nitrogen/generated/android/nitrofetch+autolinking.gradle +1 -1
  47. package/nitrogen/generated/android/nitrofetchOnLoad.cpp +1 -1
  48. package/nitrogen/generated/android/nitrofetchOnLoad.hpp +1 -1
  49. package/nitrogen/generated/ios/NitroFetch+autolinking.rb +1 -1
  50. package/nitrogen/generated/ios/NitroFetch-Swift-Cxx-Bridge.cpp +1 -1
  51. package/nitrogen/generated/ios/NitroFetch-Swift-Cxx-Bridge.hpp +1 -1
  52. package/nitrogen/generated/ios/NitroFetch-Swift-Cxx-Umbrella.hpp +1 -1
  53. package/nitrogen/generated/ios/NitroFetchAutolinking.mm +1 -1
  54. package/nitrogen/generated/ios/NitroFetchAutolinking.swift +1 -1
  55. package/nitrogen/generated/ios/c++/HybridNativeStorageSpecSwift.cpp +1 -1
  56. package/nitrogen/generated/ios/c++/HybridNativeStorageSpecSwift.hpp +1 -1
  57. package/nitrogen/generated/ios/c++/HybridNitroFetchClientSpecSwift.cpp +1 -1
  58. package/nitrogen/generated/ios/c++/HybridNitroFetchClientSpecSwift.hpp +1 -1
  59. package/nitrogen/generated/ios/c++/HybridNitroFetchSpecSwift.cpp +1 -1
  60. package/nitrogen/generated/ios/c++/HybridNitroFetchSpecSwift.hpp +1 -1
  61. package/nitrogen/generated/ios/swift/Func_void.swift +1 -1
  62. package/nitrogen/generated/ios/swift/Func_void_NitroResponse.swift +1 -1
  63. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -1
  64. package/nitrogen/generated/ios/swift/HybridNativeStorageSpec.swift +1 -1
  65. package/nitrogen/generated/ios/swift/HybridNativeStorageSpec_cxx.swift +1 -1
  66. package/nitrogen/generated/ios/swift/HybridNitroFetchClientSpec.swift +1 -1
  67. package/nitrogen/generated/ios/swift/HybridNitroFetchClientSpec_cxx.swift +1 -1
  68. package/nitrogen/generated/ios/swift/HybridNitroFetchSpec.swift +1 -1
  69. package/nitrogen/generated/ios/swift/HybridNitroFetchSpec_cxx.swift +1 -1
  70. package/nitrogen/generated/ios/swift/NitroHeader.swift +1 -1
  71. package/nitrogen/generated/ios/swift/NitroRequest.swift +1 -1
  72. package/nitrogen/generated/ios/swift/NitroRequestMethod.swift +1 -1
  73. package/nitrogen/generated/ios/swift/NitroResponse.swift +1 -1
  74. package/nitrogen/generated/shared/c++/HybridNativeStorageSpec.cpp +1 -1
  75. package/nitrogen/generated/shared/c++/HybridNativeStorageSpec.hpp +1 -1
  76. package/nitrogen/generated/shared/c++/HybridNitroFetchClientSpec.cpp +1 -1
  77. package/nitrogen/generated/shared/c++/HybridNitroFetchClientSpec.hpp +1 -1
  78. package/nitrogen/generated/shared/c++/HybridNitroFetchSpec.cpp +1 -1
  79. package/nitrogen/generated/shared/c++/HybridNitroFetchSpec.hpp +1 -1
  80. package/nitrogen/generated/shared/c++/NitroHeader.hpp +1 -1
  81. package/nitrogen/generated/shared/c++/NitroRequest.hpp +1 -1
  82. package/nitrogen/generated/shared/c++/NitroRequestMethod.hpp +1 -1
  83. package/nitrogen/generated/shared/c++/NitroResponse.hpp +1 -1
  84. package/package.json +163 -162
  85. package/src/NitroFetch.nitro.ts +67 -67
  86. package/src/NitroInstances.ts +14 -14
  87. package/src/fetch.ts +603 -603
  88. package/src/index.tsx +17 -17
  89. package/src/type.ts +3 -3
package/package.json CHANGED
@@ -1,162 +1,163 @@
1
- {
2
- "name": "@pigeonmal/react-native-nitro-fetch",
3
- "version": "0.1.9",
4
- "description": "Awesome Fetch :)",
5
- "main": "./lib/module/index.js",
6
- "module": "./lib/module/index.js",
7
- "types": "./lib/typescript/src/index.d.ts",
8
- "react-native": "src/index",
9
- "source": "./src/index",
10
- "exports": {
11
- ".": {
12
- "source": "./src/index.tsx",
13
- "types": "./lib/typescript/src/index.d.ts",
14
- "default": "./lib/module/index.js"
15
- },
16
- "./package.json": "./package.json"
17
- },
18
- "files": [
19
- "src",
20
- "lib",
21
- "android",
22
- "ios",
23
- "cpp",
24
- "nitrogen",
25
- "nitro.json",
26
- "*.podspec",
27
- "react-native.config.js",
28
- "!ios/build",
29
- "!android/build",
30
- "!android/gradle",
31
- "!android/gradlew",
32
- "!android/gradlew.bat",
33
- "!android/local.properties",
34
- "!**/__tests__",
35
- "!**/__fixtures__",
36
- "!**/__mocks__",
37
- "!**/.*"
38
- ],
39
- "scripts": {
40
- "test": "jest",
41
- "typecheck": "tsc",
42
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
43
- "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
44
- "prepare": "bob build",
45
- "nitrogen": "nitrogen",
46
- "release": "release-it --only-version"
47
- },
48
- "keywords": [
49
- "react-native",
50
- "ios",
51
- "android"
52
- ],
53
- "repository": {
54
- "type": "git",
55
- "url": "git+https://github.com/margelo/react-native-nitro-fetch.git"
56
- },
57
- "author": "Szymon Kapala <szymon20000@gmail.com'> (https://x.com/Turbo_Szymon)",
58
- "license": "MIT",
59
- "bugs": {
60
- "url": "https://github.com/margelo/react-native-nitro-fetch/issues"
61
- },
62
- "homepage": "https://github.com/margelo/react-native-nitro-fetch#readme",
63
- "publishConfig": {
64
- "registry": "https://registry.npmjs.org/",
65
- "access": "public"
66
- },
67
- "devDependencies": {
68
- "@commitlint/config-conventional": "^19.6.0",
69
- "@eslint/compat": "^1.2.7",
70
- "@eslint/eslintrc": "^3.3.0",
71
- "@eslint/js": "^9.22.0",
72
- "@evilmartians/lefthook": "^1.5.0",
73
- "@react-native/babel-preset": "0.81.0",
74
- "@react-native/eslint-config": "^0.78.0",
75
- "@release-it/conventional-changelog": "^9.0.2",
76
- "@types/jest": "^29.5.5",
77
- "@types/react": "^19.1.0",
78
- "commitlint": "^19.6.1",
79
- "del-cli": "^5.1.0",
80
- "eslint": "^9.22.0",
81
- "eslint-config-prettier": "^10.1.1",
82
- "eslint-plugin-prettier": "^5.2.3",
83
- "jest": "^29.7.0",
84
- "nitrogen": "^0.29.2",
85
- "prettier": "^3.0.3",
86
- "react": "19.1.0",
87
- "react-native": "0.81.0",
88
- "react-native-builder-bob": "^0.40.13",
89
- "react-native-nitro-modules": "^0.29.2",
90
- "release-it": "^17.10.0",
91
- "turbo": "^1.10.7",
92
- "typescript": "^5.8.3"
93
- },
94
- "peerDependencies": {
95
- "react": "*",
96
- "react-native": "*",
97
- "react-native-nitro-modules": ">=0.27.2",
98
- "react-native-worklets-core": ">=1.6.0"
99
- },
100
- "peerDependenciesMeta": {
101
- "react-native-worklets-core": {
102
- "optional": true
103
- }
104
- },
105
- "workspaces": [
106
- "example"
107
- ],
108
- "packageManager": "yarn@3.6.1",
109
- "jest": {
110
- "preset": "react-native",
111
- "modulePathIgnorePatterns": [
112
- "<rootDir>/example/node_modules",
113
- "<rootDir>/lib/"
114
- ]
115
- },
116
- "release-it": {
117
- "git": false,
118
- "npm": {
119
- "publish": true
120
- },
121
- "github": {
122
- "release": false
123
- }
124
- },
125
- "prettier": {
126
- "quoteProps": "consistent",
127
- "singleQuote": true,
128
- "tabWidth": 2,
129
- "trailingComma": "es5",
130
- "useTabs": false
131
- },
132
- "react-native-builder-bob": {
133
- "source": "src",
134
- "output": "lib",
135
- "targets": [
136
- [
137
- "custom",
138
- {
139
- "script": "nitrogen",
140
- "clean": "nitrogen/"
141
- }
142
- ],
143
- [
144
- "module",
145
- {
146
- "esm": true
147
- }
148
- ],
149
- [
150
- "typescript",
151
- {
152
- "project": "tsconfig.build.json"
153
- }
154
- ]
155
- ]
156
- },
157
- "create-react-native-library": {
158
- "languages": "kotlin-swift",
159
- "type": "nitro-module",
160
- "version": "0.53.0"
161
- }
162
- }
1
+ {
2
+ "name": "@pigeonmal/react-native-nitro-fetch",
3
+ "version": "0.2.1",
4
+ "description": "Awesome Fetch :)",
5
+ "main": "./lib/module/index.js",
6
+ "module": "./lib/module/index.js",
7
+ "types": "./lib/typescript/src/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "./src/index",
10
+ "exports": {
11
+ ".": {
12
+ "source": "./src/index.tsx",
13
+ "types": "./lib/typescript/src/index.d.ts",
14
+ "default": "./lib/module/index.js"
15
+ },
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": [
19
+ "src",
20
+ "lib",
21
+ "android",
22
+ "ios",
23
+ "cpp",
24
+ "nitrogen",
25
+ "nitro.json",
26
+ "*.podspec",
27
+ "react-native.config.js",
28
+ "!ios/build",
29
+ "!android/build",
30
+ "!android/gradle",
31
+ "!android/gradlew",
32
+ "!android/gradlew.bat",
33
+ "!android/local.properties",
34
+ "!**/__tests__",
35
+ "!**/__fixtures__",
36
+ "!**/__mocks__",
37
+ "!**/.*"
38
+ ],
39
+ "scripts": {
40
+ "test": "jest",
41
+ "typecheck": "tsc",
42
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
43
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
44
+ "prepare": "bob build",
45
+ "nitrogen": "nitrogen",
46
+ "release": "release-it --only-version"
47
+ },
48
+ "keywords": [
49
+ "react-native",
50
+ "ios",
51
+ "android"
52
+ ],
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/margelo/react-native-nitro-fetch.git"
56
+ },
57
+ "author": "Szymon Kapala <szymon20000@gmail.com'> (https://x.com/Turbo_Szymon)",
58
+ "license": "MIT",
59
+ "bugs": {
60
+ "url": "https://github.com/margelo/react-native-nitro-fetch/issues"
61
+ },
62
+ "homepage": "https://github.com/margelo/react-native-nitro-fetch#readme",
63
+ "publishConfig": {
64
+ "registry": "https://registry.npmjs.org/",
65
+ "access": "public"
66
+ },
67
+ "devDependencies": {
68
+ "@commitlint/config-conventional": "^19.6.0",
69
+ "@eslint/compat": "^1.2.7",
70
+ "@eslint/eslintrc": "^3.3.0",
71
+ "@eslint/js": "^9.22.0",
72
+ "@evilmartians/lefthook": "^1.5.0",
73
+ "@react-native/babel-preset": "0.81.0",
74
+ "@react-native/eslint-config": "^0.78.0",
75
+ "@release-it/conventional-changelog": "^9.0.2",
76
+ "@types/jest": "^29.5.5",
77
+ "@types/react": "^19.1.0",
78
+ "commitlint": "^19.6.1",
79
+ "del-cli": "^5.1.0",
80
+ "eslint": "^9.22.0",
81
+ "eslint-config-prettier": "^10.1.1",
82
+ "eslint-plugin-prettier": "^5.2.3",
83
+ "jest": "^29.7.0",
84
+ "nitrogen": "^0.29.2",
85
+ "prettier": "^3.0.3",
86
+ "react": "19.1.0",
87
+ "react-native": "0.81.0",
88
+ "react-native-builder-bob": "^0.40.13",
89
+ "react-native-nitro-modules": "^0.29.2",
90
+ "release-it": "^17.10.0",
91
+ "turbo": "^1.10.7",
92
+ "typescript": "^5.8.3"
93
+ },
94
+ "peerDependencies": {
95
+ "react": "*",
96
+ "react-native": "*",
97
+ "react-native-nitro-modules": ">=0.27.2",
98
+ "react-native-worklets-core": ">=1.6.0"
99
+ },
100
+ "peerDependenciesMeta": {
101
+ "react-native-worklets-core": {
102
+ "optional": true
103
+ }
104
+ },
105
+ "workspaces": [
106
+ "example"
107
+ ],
108
+ "packageManager": "yarn@3.6.1",
109
+ "jest": {
110
+ "preset": "react-native",
111
+ "modulePathIgnorePatterns": [
112
+ "<rootDir>/example/node_modules",
113
+ "<rootDir>/lib/"
114
+ ]
115
+ },
116
+ "release-it": {
117
+ "git": false,
118
+ "npm": {
119
+ "publish": true
120
+ },
121
+ "github": {
122
+ "release": false
123
+ }
124
+ },
125
+ "prettier": {
126
+ "quoteProps": "consistent",
127
+ "singleQuote": true,
128
+ "tabWidth": 2,
129
+ "trailingComma": "es5",
130
+ "useTabs": false
131
+ },
132
+ "react-native-builder-bob": {
133
+ "source": "src",
134
+ "output": "lib",
135
+ "targets": [
136
+ [
137
+ "custom",
138
+ {
139
+ "script": "nitrogen",
140
+ "clean": "nitrogen/"
141
+ }
142
+ ],
143
+ [
144
+ "module",
145
+ {
146
+ "esm": true
147
+ }
148
+ ],
149
+ [
150
+ "typescript",
151
+ {
152
+ "project": "tsconfig.build.json",
153
+ "tsc": "../node_modules/.bin/tsc.exe"
154
+ }
155
+ ]
156
+ ]
157
+ },
158
+ "create-react-native-library": {
159
+ "languages": "kotlin-swift",
160
+ "type": "nitro-module",
161
+ "version": "0.53.0"
162
+ }
163
+ }
@@ -1,67 +1,67 @@
1
- import type { HybridObject } from 'react-native-nitro-modules';
2
-
3
- // Minimal request/response types to model WHATWG fetch without streaming.
4
- export type NitroRequestMethod =
5
- | 'GET'
6
- | 'HEAD'
7
- | 'POST'
8
- | 'PUT'
9
- | 'PATCH'
10
- | 'DELETE'
11
- | 'OPTIONS';
12
-
13
- export interface NitroHeader {
14
- key: string;
15
- value: string;
16
- }
17
- export interface NitroRequest {
18
- url: string;
19
- method?: NitroRequestMethod;
20
- // Flattened list to keep bridging simple and deterministic
21
- headers?: NitroHeader[];
22
- // Body as either UTF-8 string or raw bytes.
23
- bodyString?: string;
24
- bodyBytes?: string; //will be ArrayBuffer in future
25
- // Controls
26
- timeoutMs?: number;
27
- followRedirects?: boolean; // default true
28
- }
29
-
30
- export interface NitroResponse {
31
- url: string; // final URL after redirects
32
- status: number;
33
- statusText: string;
34
- ok: boolean;
35
- redirected: boolean;
36
- headers: NitroHeader[];
37
- // Body as either UTF-8 string or raw bytes (first implementation target)
38
- bodyString?: string;
39
- bodyBytes?: string; //will be ArrayBuffer in future
40
- }
41
-
42
- export interface NitroFetchClient
43
- extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
44
- // Client-binded request that uses the env configured at creation.
45
- request(req: NitroRequest): Promise<NitroResponse>;
46
- // Start a prefetch for a given request; expects a header `prefetchKey`.
47
- prefetch(req: NitroRequest): Promise<void>;
48
-
49
- // Synchronous version of request for worklets
50
- requestSync(req: NitroRequest): NitroResponse;
51
- }
52
-
53
- export interface NitroFetch
54
- extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
55
- // Create a client bound to a given environment (e.g., cache dir).
56
- createClient(): NitroFetchClient;
57
-
58
- // Optional future: global abort/teardown
59
- // shutdown(): void;
60
- }
61
-
62
- export interface NativeStorage
63
- extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
64
- getString(key: string): string;
65
- setString(key: string, value: string): void;
66
- removeString(key: string): void;
67
- }
1
+ import type { HybridObject } from 'react-native-nitro-modules';
2
+
3
+ // Minimal request/response types to model WHATWG fetch without streaming.
4
+ export type NitroRequestMethod =
5
+ | 'GET'
6
+ | 'HEAD'
7
+ | 'POST'
8
+ | 'PUT'
9
+ | 'PATCH'
10
+ | 'DELETE'
11
+ | 'OPTIONS';
12
+
13
+ export interface NitroHeader {
14
+ key: string;
15
+ value: string;
16
+ }
17
+ export interface NitroRequest {
18
+ url: string;
19
+ method?: NitroRequestMethod;
20
+ // Flattened list to keep bridging simple and deterministic
21
+ headers?: NitroHeader[];
22
+ // Body as either UTF-8 string or raw bytes.
23
+ bodyString?: string;
24
+ bodyBytes?: string; //will be ArrayBuffer in future
25
+ // Controls
26
+ timeoutMs?: number;
27
+ followRedirects?: boolean; // default true
28
+ }
29
+
30
+ export interface NitroResponse {
31
+ url: string; // final URL after redirects
32
+ status: number;
33
+ statusText: string;
34
+ ok: boolean;
35
+ redirected: boolean;
36
+ headers: NitroHeader[];
37
+ // Body as either UTF-8 string or raw bytes (first implementation target)
38
+ bodyString?: string;
39
+ bodyBytes?: string; //will be ArrayBuffer in future
40
+ }
41
+
42
+ export interface NitroFetchClient
43
+ extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
44
+ // Client-binded request that uses the env configured at creation.
45
+ request(req: NitroRequest): Promise<NitroResponse>;
46
+ // Start a prefetch for a given request; expects a header `prefetchKey`.
47
+ prefetch(req: NitroRequest): Promise<void>;
48
+
49
+ // Synchronous version of request for worklets
50
+ requestSync(req: NitroRequest): NitroResponse;
51
+ }
52
+
53
+ export interface NitroFetch
54
+ extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
55
+ // Create a client bound to a given environment (e.g., cache dir).
56
+ createClient(): NitroFetchClient;
57
+
58
+ // Optional future: global abort/teardown
59
+ // shutdown(): void;
60
+ }
61
+
62
+ export interface NativeStorage
63
+ extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> {
64
+ getString(key: string): string;
65
+ setString(key: string, value: string): void;
66
+ removeString(key: string): void;
67
+ }
@@ -1,14 +1,14 @@
1
- import { NitroModules } from 'react-native-nitro-modules';
2
- import type {
3
- NitroFetch as NitroFetchType,
4
- NativeStorage as NativeStorageType,
5
- } from './NitroFetch.nitro';
6
-
7
- // Create singletons once per JS runtime
8
- export const NitroFetch: NitroFetchType =
9
- NitroModules.createHybridObject<NitroFetchType>('NitroFetch');
10
-
11
- export const NativeStorage: NativeStorageType =
12
- NitroModules.createHybridObject<NativeStorageType>('NativeStorage');
13
-
14
- export const boxedNitroFetch = NitroModules.box(NitroFetch);
1
+ import { NitroModules } from 'react-native-nitro-modules';
2
+ import type {
3
+ NitroFetch as NitroFetchType,
4
+ NativeStorage as NativeStorageType,
5
+ } from './NitroFetch.nitro';
6
+
7
+ // Create singletons once per JS runtime
8
+ export const NitroFetch: NitroFetchType =
9
+ NitroModules.createHybridObject<NitroFetchType>('NitroFetch');
10
+
11
+ export const NativeStorage: NativeStorageType =
12
+ NitroModules.createHybridObject<NativeStorageType>('NativeStorage');
13
+
14
+ export const boxedNitroFetch = NitroModules.box(NitroFetch);