@symbiote-native/device 0.2.0 → 0.3.0
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.
- package/README.md +31 -16
- package/build/core/device.js +3 -1
- package/build-ngc/core/device.js +3 -1
- package/build-ngc/core/device.js.map +1 -1
- package/build-ngc/core/native-module.js.map +1 -1
- package/package.json +28 -14
- package/src/core/device.ts +22 -8
- package/src/core/native-module.ts +3 -1
- package/build/react/index.d.ts +0 -1
- package/build/react/index.js +0 -6
- package/build/svelte/index.d.ts +0 -1
- package/build/svelte/index.js +0 -6
- package/build/vue/index.d.ts +0 -1
- package/build/vue/index.js +0 -4
- package/src/react/index.ts +0 -6
- package/src/svelte/index.ts +0 -6
- package/src/vue/index.ts +0 -4
package/README.md
CHANGED
|
@@ -28,12 +28,12 @@ Unlike a plain RN native module, `expo-device`'s native code is discovered by
|
|
|
28
28
|
into the native host app **once**, covering this package and every other `expo-modules-core`
|
|
29
29
|
package with zero further changes:
|
|
30
30
|
|
|
31
|
-
| Platform | Touches
|
|
32
|
-
|
|
33
|
-
| iOS
|
|
34
|
-
| iOS
|
|
35
|
-
| Android
|
|
36
|
-
| Android
|
|
31
|
+
| Platform | Touches |
|
|
32
|
+
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| iOS | `ios/Podfile` — add `use_expo_modules!` |
|
|
34
|
+
| iOS | `AppDelegate.swift` — Expo's runtime-bootstrap hook |
|
|
35
|
+
| Android | `settings.gradle` / `app/build.gradle` — resolve and include the Expo Gradle projects |
|
|
36
|
+
| Android | `MainApplication.kt` — Expo's bootstrap hook, plus a hand-written native-module name map (there's no `expo` meta-package here to auto-generate one) |
|
|
37
37
|
|
|
38
38
|
Full mechanics live in the `symbiote-expo-native-module` project skill. Reference
|
|
39
39
|
implementation: `examples/expo-react/ios/Podfile` and
|
|
@@ -53,13 +53,12 @@ src/core/ Eager constants (isDevice, brand, manufacturer, modelId, modelName
|
|
|
53
53
|
isSideLoadingEnabledAsync / getPlatformFeaturesAsync / hasPlatformFeatureAsync,
|
|
54
54
|
and the DeviceType enum. native-module.ts resolves the native module via
|
|
55
55
|
expo-modules-core's requireNativeModule.
|
|
56
|
-
src/react/ @symbiote-native/device/react — export * from '../core'
|
|
57
|
-
src/vue/ @symbiote-native/device/vue — export * from '../core'
|
|
58
56
|
src/angular/ @symbiote-native/device/angular — export * from '../core'
|
|
59
57
|
```
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
`./react`, `./vue`, and `./svelte` are `exports`-map aliases straight onto `src/core/` — no
|
|
60
|
+
physical per-framework file, since there's nothing to subscribe to or clean up. `./angular` stays
|
|
61
|
+
a physical file/subpath since Angular ships through a separate `ngc`/AOT build (`build-ngc/`).
|
|
63
62
|
|
|
64
63
|
## Use it
|
|
65
64
|
|
|
@@ -93,8 +92,14 @@ function DeviceScreen() {
|
|
|
93
92
|
<Text>{`${brand ?? 'unknown'} ${modelName ?? ''}`}</Text>
|
|
94
93
|
<Text>{`${osName ?? 'unknown OS'} ${osVersion ?? ''}`}</Text>
|
|
95
94
|
<Text>{deviceName ?? 'unnamed device'}</Text>
|
|
96
|
-
<Text>
|
|
97
|
-
|
|
95
|
+
<Text>
|
|
96
|
+
{uptime === null ? 'checking uptime…' : `Uptime: ${uptime}ms`}
|
|
97
|
+
</Text>
|
|
98
|
+
<Text>
|
|
99
|
+
{maxMemory === null
|
|
100
|
+
? 'checking memory…'
|
|
101
|
+
: `Max memory: ${maxMemory} bytes`}
|
|
102
|
+
</Text>
|
|
98
103
|
</View>
|
|
99
104
|
);
|
|
100
105
|
}
|
|
@@ -131,8 +136,12 @@ onMounted(() => {
|
|
|
131
136
|
<Text>{{ `${brand ?? 'unknown'} ${modelName ?? ''}` }}</Text>
|
|
132
137
|
<Text>{{ `${osName ?? 'unknown OS'} ${osVersion ?? ''}` }}</Text>
|
|
133
138
|
<Text>{{ deviceName ?? 'unnamed device' }}</Text>
|
|
134
|
-
<Text>{{
|
|
135
|
-
|
|
139
|
+
<Text>{{
|
|
140
|
+
uptime === null ? 'checking uptime…' : `Uptime: ${uptime}ms`
|
|
141
|
+
}}</Text>
|
|
142
|
+
<Text>{{
|
|
143
|
+
maxMemory === null ? 'checking memory…' : `Max memory: ${maxMemory} bytes`
|
|
144
|
+
}}</Text>
|
|
136
145
|
</View>
|
|
137
146
|
</template>
|
|
138
147
|
```
|
|
@@ -161,8 +170,14 @@ import {
|
|
|
161
170
|
<Text>{{ brand ?? 'unknown' }} {{ modelName ?? '' }}</Text>
|
|
162
171
|
<Text>{{ osName ?? 'unknown OS' }} {{ osVersion ?? '' }}</Text>
|
|
163
172
|
<Text>{{ deviceName ?? 'unnamed device' }}</Text>
|
|
164
|
-
<Text>{{
|
|
165
|
-
|
|
173
|
+
<Text>{{
|
|
174
|
+
uptime() === null ? 'checking uptime…' : 'Uptime: ' + uptime() + 'ms'
|
|
175
|
+
}}</Text>
|
|
176
|
+
<Text>{{
|
|
177
|
+
maxMemory() === null
|
|
178
|
+
? 'checking memory…'
|
|
179
|
+
: 'Max memory: ' + maxMemory() + ' bytes'
|
|
180
|
+
}}</Text>
|
|
166
181
|
</View>
|
|
167
182
|
`,
|
|
168
183
|
})
|
package/build/core/device.js
CHANGED
|
@@ -145,7 +145,9 @@ export async function getMaxMemoryAsync() {
|
|
|
145
145
|
throw new UnavailabilityError(NATIVE_MODULE_NAME, 'getMaxMemoryAsync');
|
|
146
146
|
}
|
|
147
147
|
const maxMemory = await expoDevice.getMaxMemoryAsync();
|
|
148
|
-
return maxMemory === MAX_MEMORY_UNLIMITED_SENTINEL
|
|
148
|
+
return maxMemory === MAX_MEMORY_UNLIMITED_SENTINEL
|
|
149
|
+
? Number.MAX_SAFE_INTEGER
|
|
150
|
+
: maxMemory;
|
|
149
151
|
}
|
|
150
152
|
/**
|
|
151
153
|
* Checks whether the device has been rooted (Android) or jailbroken (iOS). This is a best-effort
|
package/build-ngc/core/device.js
CHANGED
|
@@ -145,7 +145,9 @@ export async function getMaxMemoryAsync() {
|
|
|
145
145
|
throw new UnavailabilityError(NATIVE_MODULE_NAME, 'getMaxMemoryAsync');
|
|
146
146
|
}
|
|
147
147
|
const maxMemory = await expoDevice.getMaxMemoryAsync();
|
|
148
|
-
return maxMemory === MAX_MEMORY_UNLIMITED_SENTINEL
|
|
148
|
+
return maxMemory === MAX_MEMORY_UNLIMITED_SENTINEL
|
|
149
|
+
? Number.MAX_SAFE_INTEGER
|
|
150
|
+
: maxMemory;
|
|
149
151
|
}
|
|
150
152
|
/**
|
|
151
153
|
* Checks whether the device has been rooted (Android) or jailbroken (iOS). This is a best-effort
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/core/device.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,8FAA8F;AAC9F,6FAA6F;AAC7F,6BAA6B;AAC7B,EAAE;AACF,+FAA+F;AAC/F,iGAAiG;AACjG,8FAA8F;AAC9F,8FAA8F;AAC9F,+FAA+F;AAC/F,yFAAyF;AACzF,4FAA4F;AAC5F,6FAA6F;AAC7F,iGAAiG;AACjG,gGAAgG;AAChG,sEAAsE;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,kBAAkB,GAAG,aAAa,CAAC;AACzC,MAAM,6BAA6B,GAAG,CAAC,CAAC,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAY,UAAU,CAAC,QAAQ,IAAI,IAAI,CAAC;AAE7D;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAkB,UAAU,CAAC,KAAK,IAAI,IAAI,CAAC;AAE7D;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAkB,UAAU,CAAC,YAAY,IAAI,IAAI,CAAC;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C;AAChD,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB;IAC7C,IAAI,CAAC,UAAU,CAAC,yBAAyB,EAAE,CAAC;QAC1C,MAAM,IAAI,mBAAmB,CAC3B,kBAAkB,EAClB,2BAA2B,CAC5B,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC,yBAAyB,EAAE,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB;IAC5C,IAAI,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAC;QACzC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,UAAU,CAAC,wBAAwB,EAAE,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAe;IAEf,IAAI,CAAC,UAAU,CAAC,uBAAuB,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,UAAU,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AAsC7C,MAAM,CAAC,MAAM,UAAU,GAAG,mBAAmB,
|
|
1
|
+
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AAsC7C,MAAM,CAAC,MAAM,UAAU,GAAG,mBAAmB,CAC3C,uBAAuB,CACxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/device",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "expo-device wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, and Angular adapters. Device brand/model/OS constants, uptime, max-memory, root/jailbreak detection, side-loading detection, and platform-feature queries.",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "expo-device wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Device brand/model/OS constants, uptime, max-memory, root/jailbreak detection, side-loading detection, and platform-feature queries.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -23,16 +23,20 @@
|
|
|
23
23
|
"default": "./build/core/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./vue": {
|
|
26
|
-
"types": "./build/
|
|
27
|
-
"default": "./build/
|
|
26
|
+
"types": "./build/core/index.d.ts",
|
|
27
|
+
"default": "./build/core/index.js"
|
|
28
28
|
},
|
|
29
29
|
"./react": {
|
|
30
|
-
"types": "./build/
|
|
31
|
-
"default": "./build/
|
|
30
|
+
"types": "./build/core/index.d.ts",
|
|
31
|
+
"default": "./build/core/index.js"
|
|
32
32
|
},
|
|
33
33
|
"./svelte": {
|
|
34
|
-
"types": "./build/
|
|
35
|
-
"default": "./build/
|
|
34
|
+
"types": "./build/core/index.d.ts",
|
|
35
|
+
"default": "./build/core/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./solid": {
|
|
38
|
+
"types": "./build/core/index.d.ts",
|
|
39
|
+
"default": "./build/core/index.js"
|
|
36
40
|
},
|
|
37
41
|
"./angular": {
|
|
38
42
|
"types": "./build-ngc/angular/index.d.ts",
|
|
@@ -60,12 +64,14 @@
|
|
|
60
64
|
"@symbiote-native/angular": ">=0.6.2",
|
|
61
65
|
"@symbiote-native/engine": ">=0.1.7",
|
|
62
66
|
"@symbiote-native/react": ">=0.2.8",
|
|
67
|
+
"@symbiote-native/solid": ">=0.0.1",
|
|
63
68
|
"@symbiote-native/svelte": ">=0.1.0",
|
|
64
69
|
"@symbiote-native/vue": ">=0.3.8",
|
|
65
70
|
"@angular/core": ">=20",
|
|
66
71
|
"@vue/runtime-core": "^3.5.13",
|
|
67
72
|
"react": ">=19.0.0",
|
|
68
73
|
"react-native": ">=0.86",
|
|
74
|
+
"solid-js": ">=1.9.0",
|
|
69
75
|
"svelte": ">=5.56.0",
|
|
70
76
|
"vue": ">=3.5.0"
|
|
71
77
|
},
|
|
@@ -76,6 +82,9 @@
|
|
|
76
82
|
"@symbiote-native/react": {
|
|
77
83
|
"optional": true
|
|
78
84
|
},
|
|
85
|
+
"@symbiote-native/solid": {
|
|
86
|
+
"optional": true
|
|
87
|
+
},
|
|
79
88
|
"@symbiote-native/svelte": {
|
|
80
89
|
"optional": true
|
|
81
90
|
},
|
|
@@ -91,6 +100,9 @@
|
|
|
91
100
|
"react": {
|
|
92
101
|
"optional": true
|
|
93
102
|
},
|
|
103
|
+
"solid-js": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
94
106
|
"svelte": {
|
|
95
107
|
"optional": true
|
|
96
108
|
},
|
|
@@ -106,14 +118,16 @@
|
|
|
106
118
|
"@types/react": "^19.2.0",
|
|
107
119
|
"@vue/runtime-core": "^3.5.13",
|
|
108
120
|
"react": "19.2.3",
|
|
121
|
+
"solid-js": "^1.9.14",
|
|
109
122
|
"svelte": "^5.56.0",
|
|
110
123
|
"typescript": "~6.0.0",
|
|
111
|
-
"@symbiote-native/angular": "0.
|
|
112
|
-
"@symbiote-native/engine": "0.
|
|
113
|
-
"@symbiote-native/
|
|
114
|
-
"@symbiote-native/
|
|
115
|
-
"@symbiote-native/
|
|
116
|
-
"@symbiote-native/
|
|
124
|
+
"@symbiote-native/angular": "0.8.0",
|
|
125
|
+
"@symbiote-native/engine": "0.3.0",
|
|
126
|
+
"@symbiote-native/react": "0.4.0",
|
|
127
|
+
"@symbiote-native/solid": "0.1.0",
|
|
128
|
+
"@symbiote-native/svelte": "0.3.0",
|
|
129
|
+
"@symbiote-native/test-utils": "0.2.0",
|
|
130
|
+
"@symbiote-native/vue": "0.5.0"
|
|
117
131
|
},
|
|
118
132
|
"scripts": {
|
|
119
133
|
"typecheck": "tsc --build",
|
package/src/core/device.ts
CHANGED
|
@@ -73,7 +73,8 @@ export const productName: string | null = expoDevice.productName ?? null;
|
|
|
73
73
|
export const deviceType: DeviceType | null = expoDevice.deviceType ?? null;
|
|
74
74
|
|
|
75
75
|
/** The device year class (https://github.com/facebook/device-year-class) of this device. */
|
|
76
|
-
export const deviceYearClass: number | null =
|
|
76
|
+
export const deviceYearClass: number | null =
|
|
77
|
+
expoDevice.deviceYearClass ?? null;
|
|
77
78
|
|
|
78
79
|
/**
|
|
79
80
|
* The device's total memory, in bytes — the total memory accessible to the kernel, but not
|
|
@@ -110,19 +111,22 @@ export const osBuildId: string | null = expoDevice.osBuildId ?? null;
|
|
|
110
111
|
* The internal build ID of the OS running on the device. On Android this corresponds to
|
|
111
112
|
* `Build.ID`; on iOS it's the same value as {@link osBuildId}.
|
|
112
113
|
*/
|
|
113
|
-
export const osInternalBuildId: string | null =
|
|
114
|
+
export const osInternalBuildId: string | null =
|
|
115
|
+
expoDevice.osInternalBuildId ?? null;
|
|
114
116
|
|
|
115
117
|
/**
|
|
116
118
|
* A string that uniquely identifies the build of the currently running system OS.
|
|
117
119
|
* @platform android
|
|
118
120
|
*/
|
|
119
|
-
export const osBuildFingerprint: string | null =
|
|
121
|
+
export const osBuildFingerprint: string | null =
|
|
122
|
+
expoDevice.osBuildFingerprint ?? null;
|
|
120
123
|
|
|
121
124
|
/**
|
|
122
125
|
* The Android SDK version of the software currently running on this hardware device.
|
|
123
126
|
* @platform android
|
|
124
127
|
*/
|
|
125
|
-
export const platformApiLevel: number | null =
|
|
128
|
+
export const platformApiLevel: number | null =
|
|
129
|
+
expoDevice.platformApiLevel ?? null;
|
|
126
130
|
|
|
127
131
|
/**
|
|
128
132
|
* The human-readable name of the device, which may be set by the device's user. `null` if the
|
|
@@ -169,7 +173,9 @@ export async function getMaxMemoryAsync(): Promise<number> {
|
|
|
169
173
|
throw new UnavailabilityError(NATIVE_MODULE_NAME, 'getMaxMemoryAsync');
|
|
170
174
|
}
|
|
171
175
|
const maxMemory = await expoDevice.getMaxMemoryAsync();
|
|
172
|
-
return maxMemory === MAX_MEMORY_UNLIMITED_SENTINEL
|
|
176
|
+
return maxMemory === MAX_MEMORY_UNLIMITED_SENTINEL
|
|
177
|
+
? Number.MAX_SAFE_INTEGER
|
|
178
|
+
: maxMemory;
|
|
173
179
|
}
|
|
174
180
|
|
|
175
181
|
/**
|
|
@@ -179,7 +185,10 @@ export async function getMaxMemoryAsync(): Promise<number> {
|
|
|
179
185
|
*/
|
|
180
186
|
export async function isRootedExperimentalAsync(): Promise<boolean> {
|
|
181
187
|
if (!expoDevice.isRootedExperimentalAsync) {
|
|
182
|
-
throw new UnavailabilityError(
|
|
188
|
+
throw new UnavailabilityError(
|
|
189
|
+
NATIVE_MODULE_NAME,
|
|
190
|
+
'isRootedExperimentalAsync',
|
|
191
|
+
);
|
|
183
192
|
}
|
|
184
193
|
return expoDevice.isRootedExperimentalAsync();
|
|
185
194
|
}
|
|
@@ -192,7 +201,10 @@ export async function isRootedExperimentalAsync(): Promise<boolean> {
|
|
|
192
201
|
*/
|
|
193
202
|
export async function isSideLoadingEnabledAsync(): Promise<boolean> {
|
|
194
203
|
if (!expoDevice.isSideLoadingEnabledAsync) {
|
|
195
|
-
throw new UnavailabilityError(
|
|
204
|
+
throw new UnavailabilityError(
|
|
205
|
+
NATIVE_MODULE_NAME,
|
|
206
|
+
'isSideLoadingEnabledAsync',
|
|
207
|
+
);
|
|
196
208
|
}
|
|
197
209
|
return expoDevice.isSideLoadingEnabledAsync();
|
|
198
210
|
}
|
|
@@ -214,7 +226,9 @@ export async function getPlatformFeaturesAsync(): Promise<string[]> {
|
|
|
214
226
|
* when the native method is absent (e.g. on iOS), matching upstream.
|
|
215
227
|
* @platform android
|
|
216
228
|
*/
|
|
217
|
-
export async function hasPlatformFeatureAsync(
|
|
229
|
+
export async function hasPlatformFeatureAsync(
|
|
230
|
+
feature: string,
|
|
231
|
+
): Promise<boolean> {
|
|
218
232
|
if (!expoDevice.hasPlatformFeatureAsync) {
|
|
219
233
|
return false;
|
|
220
234
|
}
|
|
@@ -39,4 +39,6 @@ export type INativeDeviceModule = {
|
|
|
39
39
|
hasPlatformFeatureAsync?(feature: string): Promise<boolean>;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
export const expoDevice = requireNativeModule<INativeDeviceModule>(
|
|
42
|
+
export const expoDevice = requireNativeModule<INativeDeviceModule>(
|
|
43
|
+
EXPO_DEVICE_MODULE_NAME,
|
|
44
|
+
);
|
package/build/react/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/react/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/device/react: the React entry over the framework-agnostic core. Upstream
|
|
2
|
-
// ships eager constants and free async functions, no per-instance state and no event stream
|
|
3
|
-
// (unlike @symbiote-native/sensors) — there is nothing for a hook to wrap, so this is a plain
|
|
4
|
-
// re-export, mirroring how @symbiote-native/local-auth's React entry passes its own free
|
|
5
|
-
// functions through untouched.
|
|
6
|
-
export * from '../core/index.js';
|
package/build/svelte/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/svelte/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/device/svelte: the Svelte entry over the framework-agnostic core. Upstream
|
|
2
|
-
// ships eager constants and free async functions, no per-instance state and no event stream
|
|
3
|
-
// (unlike @symbiote-native/sensors) — there is nothing for a rune to wrap, so this is a plain
|
|
4
|
-
// re-export. Svelte's lifecycle bucket is `runes/` (adapters/svelte/src/runes — never React's
|
|
5
|
-
// `hooks` or Vue's `composables`), and this package has none to fill.
|
|
6
|
-
export * from '../core/index.js';
|
package/build/vue/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core';
|
package/build/vue/index.js
DELETED
package/src/react/index.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/device/react: the React entry over the framework-agnostic core. Upstream
|
|
2
|
-
// ships eager constants and free async functions, no per-instance state and no event stream
|
|
3
|
-
// (unlike @symbiote-native/sensors) — there is nothing for a hook to wrap, so this is a plain
|
|
4
|
-
// re-export, mirroring how @symbiote-native/local-auth's React entry passes its own free
|
|
5
|
-
// functions through untouched.
|
|
6
|
-
export * from '../core';
|
package/src/svelte/index.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/device/svelte: the Svelte entry over the framework-agnostic core. Upstream
|
|
2
|
-
// ships eager constants and free async functions, no per-instance state and no event stream
|
|
3
|
-
// (unlike @symbiote-native/sensors) — there is nothing for a rune to wrap, so this is a plain
|
|
4
|
-
// re-export. Svelte's lifecycle bucket is `runes/` (adapters/svelte/src/runes — never React's
|
|
5
|
-
// `hooks` or Vue's `composables`), and this package has none to fill.
|
|
6
|
-
export * from '../core';
|
package/src/vue/index.ts
DELETED