@symbiote-native/local-auth 0.3.0 → 0.4.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 +48 -21
- package/build/core/local-authentication.js +2 -1
- package/build-ngc/core/local-authentication.js +2 -1
- package/build-ngc/core/local-authentication.js.map +1 -1
- package/build-ngc/core/native-module.js.map +1 -1
- package/package.json +28 -14
- package/src/core/local-authentication.ts +9 -3
- package/src/core/native-module.ts +8 -4
- 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
|
@@ -26,12 +26,12 @@ Unlike a plain RN native module, `expo-local-authentication`'s native code is di
|
|
|
26
26
|
into the native host app **once**, covering this package and every other
|
|
27
27
|
`expo-modules-core` package with zero further changes:
|
|
28
28
|
|
|
29
|
-
| Platform | Touches
|
|
30
|
-
|
|
31
|
-
| iOS
|
|
32
|
-
| iOS
|
|
33
|
-
| Android
|
|
34
|
-
| Android
|
|
29
|
+
| Platform | Touches |
|
|
30
|
+
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| iOS | `ios/Podfile` — add `use_expo_modules!` |
|
|
32
|
+
| iOS | `AppDelegate.swift` — Expo's runtime-bootstrap hook |
|
|
33
|
+
| Android | `settings.gradle` / `app/build.gradle` — resolve and include the Expo Gradle projects |
|
|
34
|
+
| 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) |
|
|
35
35
|
|
|
36
36
|
Full mechanics live in the `symbiote-expo-native-module` project skill. Reference
|
|
37
37
|
implementation: `examples/expo-react/ios/Podfile` and
|
|
@@ -52,13 +52,12 @@ src/core/ hasHardwareAsync / isEnrolledAsync / getEnrolledLevelAsync /
|
|
|
52
52
|
AuthenticationType, SecurityLevel, and the option/result/error types.
|
|
53
53
|
native-module.ts resolves the native module via expo-modules-core's
|
|
54
54
|
requireNativeModule.
|
|
55
|
-
src/react/ @symbiote-native/local-auth/react — export * from '../core'
|
|
56
|
-
src/vue/ @symbiote-native/local-auth/vue — export * from '../core'
|
|
57
55
|
src/angular/ @symbiote-native/local-auth/angular — export * from '../core'
|
|
58
56
|
```
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
`./react`, `./vue`, and `./svelte` are `exports`-map aliases straight onto `src/core/` — no
|
|
59
|
+
physical per-framework file, since there's nothing to subscribe to or clean up. `./angular` stays
|
|
60
|
+
a physical file/subpath since Angular ships through a separate `ngc`/AOT build (`build-ngc/`).
|
|
62
61
|
|
|
63
62
|
## Use it
|
|
64
63
|
|
|
@@ -77,7 +76,8 @@ import type { ILocalAuthenticationResult } from '@symbiote-native/local-auth/rea
|
|
|
77
76
|
function LocalAuthScreen() {
|
|
78
77
|
const [hasHardware, setHasHardware] = useState(false);
|
|
79
78
|
const [isEnrolled, setIsEnrolled] = useState(false);
|
|
80
|
-
const [authResult, setAuthResult] =
|
|
79
|
+
const [authResult, setAuthResult] =
|
|
80
|
+
useState<ILocalAuthenticationResult | null>(null);
|
|
81
81
|
|
|
82
82
|
useEffect(() => {
|
|
83
83
|
hasHardwareAsync().then(setHasHardware);
|
|
@@ -85,12 +85,18 @@ function LocalAuthScreen() {
|
|
|
85
85
|
}, []);
|
|
86
86
|
|
|
87
87
|
const handleAuthenticate = () => {
|
|
88
|
-
authenticateAsync({ promptMessage: 'Confirm it is you' }).then(
|
|
88
|
+
authenticateAsync({ promptMessage: 'Confirm it is you' }).then(
|
|
89
|
+
setAuthResult,
|
|
90
|
+
);
|
|
89
91
|
};
|
|
90
92
|
|
|
91
93
|
return (
|
|
92
94
|
<View>
|
|
93
|
-
<Text>
|
|
95
|
+
<Text>
|
|
96
|
+
{hasHardware && isEnrolled
|
|
97
|
+
? 'Ready to authenticate'
|
|
98
|
+
: 'No biometrics enrolled'}
|
|
99
|
+
</Text>
|
|
94
100
|
<Pressable onPress={handleAuthenticate}>
|
|
95
101
|
<Text>Authenticate</Text>
|
|
96
102
|
</Pressable>
|
|
@@ -99,7 +105,11 @@ function LocalAuthScreen() {
|
|
|
99
105
|
<Text>Cancel</Text>
|
|
100
106
|
</Pressable>
|
|
101
107
|
)}
|
|
102
|
-
{authResult &&
|
|
108
|
+
{authResult && (
|
|
109
|
+
<Text>
|
|
110
|
+
{authResult.success ? 'Success' : `Failed: ${authResult.error}`}
|
|
111
|
+
</Text>
|
|
112
|
+
)}
|
|
103
113
|
</View>
|
|
104
114
|
);
|
|
105
115
|
}
|
|
@@ -136,14 +146,20 @@ function handleAuthenticate(): void {
|
|
|
136
146
|
|
|
137
147
|
<template>
|
|
138
148
|
<View>
|
|
139
|
-
<Text>{{
|
|
149
|
+
<Text>{{
|
|
150
|
+
hasHardware && isEnrolled
|
|
151
|
+
? 'Ready to authenticate'
|
|
152
|
+
: 'No biometrics enrolled'
|
|
153
|
+
}}</Text>
|
|
140
154
|
<Pressable @press="handleAuthenticate">
|
|
141
155
|
<Text>Authenticate</Text>
|
|
142
156
|
</Pressable>
|
|
143
157
|
<Pressable v-if="Platform.OS === 'android'" @press="cancelAuthenticate">
|
|
144
158
|
<Text>Cancel</Text>
|
|
145
159
|
</Pressable>
|
|
146
|
-
<Text v-if="authResult">{{
|
|
160
|
+
<Text v-if="authResult">{{
|
|
161
|
+
authResult.success ? 'Success' : `Failed: ${authResult.error}`
|
|
162
|
+
}}</Text>
|
|
147
163
|
</View>
|
|
148
164
|
</template>
|
|
149
165
|
```
|
|
@@ -165,7 +181,11 @@ import type { ILocalAuthenticationResult } from '@symbiote-native/local-auth/ang
|
|
|
165
181
|
imports: [Pressable, Text, View],
|
|
166
182
|
template: `
|
|
167
183
|
<View>
|
|
168
|
-
<Text>{{
|
|
184
|
+
<Text>{{
|
|
185
|
+
hasHardware() && isEnrolled()
|
|
186
|
+
? 'Ready to authenticate'
|
|
187
|
+
: 'No biometrics enrolled'
|
|
188
|
+
}}</Text>
|
|
169
189
|
<Pressable (press)="handleAuthenticate()">
|
|
170
190
|
<Text>Authenticate</Text>
|
|
171
191
|
</Pressable>
|
|
@@ -175,7 +195,9 @@ import type { ILocalAuthenticationResult } from '@symbiote-native/local-auth/ang
|
|
|
175
195
|
</Pressable>
|
|
176
196
|
}
|
|
177
197
|
@if (authResult(); as result) {
|
|
178
|
-
<Text>{{
|
|
198
|
+
<Text>{{
|
|
199
|
+
result.success ? 'Success' : 'Failed: ' + result.error
|
|
200
|
+
}}</Text>
|
|
179
201
|
}
|
|
180
202
|
</View>
|
|
181
203
|
`,
|
|
@@ -192,7 +214,9 @@ export class LocalAuthScreen {
|
|
|
192
214
|
}
|
|
193
215
|
|
|
194
216
|
handleAuthenticate(): void {
|
|
195
|
-
authenticateAsync({ promptMessage: 'Confirm it is you' }).then(value =>
|
|
217
|
+
authenticateAsync({ promptMessage: 'Confirm it is you' }).then(value =>
|
|
218
|
+
this.authResult.set(value),
|
|
219
|
+
);
|
|
196
220
|
}
|
|
197
221
|
|
|
198
222
|
handleCancel(): void {
|
|
@@ -229,7 +253,10 @@ from upstream's `LocalAuthentication.types.ts`, renamed with this repo's `I`-pre
|
|
|
229
253
|
for exported types (`ts-js-best-practices`).
|
|
230
254
|
|
|
231
255
|
```ts
|
|
232
|
-
import {
|
|
256
|
+
import {
|
|
257
|
+
authenticateAsync,
|
|
258
|
+
hasHardwareAsync,
|
|
259
|
+
} from '@symbiote-native/local-auth';
|
|
233
260
|
// or the framework-scoped entry points — identical surface, re-exported verbatim:
|
|
234
261
|
import { authenticateAsync } from '@symbiote-native/local-auth/react';
|
|
235
262
|
import { authenticateAsync } from '@symbiote-native/local-auth/vue';
|
|
@@ -241,7 +268,7 @@ import { authenticateAsync } from '@symbiote-native/local-auth/angular';
|
|
|
241
268
|
- **`not_enrolled` on Android almost always means the device's own lock screen has no PIN,
|
|
242
269
|
pattern, or password set.** A real symptom on a fresh emulator or factory-reset device:
|
|
243
270
|
`authenticateAsync` resolves `{ success: false, error: 'not_enrolled', warning:
|
|
244
|
-
|
|
271
|
+
'KeyguardManager#isDeviceSecure() returned false' }`. This is **not** a missing app
|
|
245
272
|
permission — the manifest permission this package needs is an ordinary build-time merge with
|
|
246
273
|
no runtime prompt, so there's nothing for your app to request. The fix lives on the device:
|
|
247
274
|
Settings → Security → Screen lock → set a PIN/pattern/password, then optionally enroll a
|
|
@@ -55,7 +55,8 @@ export async function authenticateAsync(options = {}) {
|
|
|
55
55
|
throw new UnavailabilityError(NATIVE_MODULE_NAME, 'authenticateAsync');
|
|
56
56
|
}
|
|
57
57
|
if (options.promptMessage !== undefined) {
|
|
58
|
-
invariant(typeof options.promptMessage === 'string' &&
|
|
58
|
+
invariant(typeof options.promptMessage === 'string' &&
|
|
59
|
+
options.promptMessage.length > 0, 'LocalAuthentication.authenticateAsync: `options.promptMessage` must be a non-empty string.');
|
|
59
60
|
}
|
|
60
61
|
return expoLocalAuthentication.authenticateAsync({
|
|
61
62
|
...options,
|
|
@@ -55,7 +55,8 @@ export async function authenticateAsync(options = {}) {
|
|
|
55
55
|
throw new UnavailabilityError(NATIVE_MODULE_NAME, 'authenticateAsync');
|
|
56
56
|
}
|
|
57
57
|
if (options.promptMessage !== undefined) {
|
|
58
|
-
invariant(typeof options.promptMessage === 'string' &&
|
|
58
|
+
invariant(typeof options.promptMessage === 'string' &&
|
|
59
|
+
options.promptMessage.length > 0, 'LocalAuthentication.authenticateAsync: `options.promptMessage` must be a non-empty string.');
|
|
59
60
|
}
|
|
60
61
|
return expoLocalAuthentication.authenticateAsync({
|
|
61
62
|
...options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-authentication.js","sourceRoot":"","sources":["../../src/core/local-authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC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IAAI,CAAC,uBAAuB,CAAC,kBAAkB,EAAE,CAAC;QAChD,MAAM,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;IAC1E,CAAC;IACD,MAAM,uBAAuB,CAAC,kBAAkB,EAAE,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;AAQxD,MAAM,qCAAqC,GAAG,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAQxD,MAAM,qCAAqC,GAAG,yBAAyB,CAAC;AAmBxE,MAAM,CAAC,MAAM,uBAAuB,GAClC,mBAAmB,CACjB,qCAAqC,CACtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/local-auth",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "expo-local-authentication wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, and Angular adapters. FaceID/TouchID on iOS, the Fingerprint/Biometric API on Android.",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "expo-local-authentication wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. FaceID/TouchID on iOS, the Fingerprint/Biometric API on Android.",
|
|
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",
|
|
@@ -61,12 +65,14 @@
|
|
|
61
65
|
"@symbiote-native/angular": ">=0.6.2",
|
|
62
66
|
"@symbiote-native/engine": ">=0.1.7",
|
|
63
67
|
"@symbiote-native/react": ">=0.2.8",
|
|
68
|
+
"@symbiote-native/solid": ">=0.0.1",
|
|
64
69
|
"@symbiote-native/svelte": ">=0.1.0",
|
|
65
70
|
"@symbiote-native/vue": ">=0.3.8",
|
|
66
71
|
"@angular/core": ">=20",
|
|
67
72
|
"@vue/runtime-core": "^3.5.13",
|
|
68
73
|
"react": ">=19.0.0",
|
|
69
74
|
"react-native": ">=0.86",
|
|
75
|
+
"solid-js": ">=1.9.0",
|
|
70
76
|
"svelte": ">=5.56.0",
|
|
71
77
|
"vue": ">=3.5.0"
|
|
72
78
|
},
|
|
@@ -77,6 +83,9 @@
|
|
|
77
83
|
"@symbiote-native/react": {
|
|
78
84
|
"optional": true
|
|
79
85
|
},
|
|
86
|
+
"@symbiote-native/solid": {
|
|
87
|
+
"optional": true
|
|
88
|
+
},
|
|
80
89
|
"@symbiote-native/svelte": {
|
|
81
90
|
"optional": true
|
|
82
91
|
},
|
|
@@ -92,6 +101,9 @@
|
|
|
92
101
|
"react": {
|
|
93
102
|
"optional": true
|
|
94
103
|
},
|
|
104
|
+
"solid-js": {
|
|
105
|
+
"optional": true
|
|
106
|
+
},
|
|
95
107
|
"svelte": {
|
|
96
108
|
"optional": true
|
|
97
109
|
},
|
|
@@ -108,14 +120,16 @@
|
|
|
108
120
|
"@types/react": "^19.2.0",
|
|
109
121
|
"@vue/runtime-core": "^3.5.13",
|
|
110
122
|
"react": "19.2.3",
|
|
123
|
+
"solid-js": "^1.9.14",
|
|
111
124
|
"svelte": "^5.56.0",
|
|
112
125
|
"typescript": "~6.0.0",
|
|
113
|
-
"@symbiote-native/angular": "0.
|
|
114
|
-
"@symbiote-native/engine": "0.
|
|
115
|
-
"@symbiote-native/react": "0.
|
|
116
|
-
"@symbiote-native/
|
|
117
|
-
"@symbiote-native/
|
|
118
|
-
"@symbiote-native/
|
|
126
|
+
"@symbiote-native/angular": "0.8.0",
|
|
127
|
+
"@symbiote-native/engine": "0.3.0",
|
|
128
|
+
"@symbiote-native/react": "0.4.0",
|
|
129
|
+
"@symbiote-native/solid": "0.1.0",
|
|
130
|
+
"@symbiote-native/svelte": "0.3.0",
|
|
131
|
+
"@symbiote-native/test-utils": "0.2.0",
|
|
132
|
+
"@symbiote-native/vue": "0.5.0"
|
|
119
133
|
},
|
|
120
134
|
"scripts": {
|
|
121
135
|
"typecheck": "tsc --build",
|
|
@@ -28,9 +28,14 @@ export async function hasHardwareAsync(): Promise<boolean> {
|
|
|
28
28
|
* multiple authentication methods — e.g. `[FINGERPRINT, FACIAL_RECOGNITION]` means the device
|
|
29
29
|
* supports both. Returns an empty array if none are supported.
|
|
30
30
|
*/
|
|
31
|
-
export async function supportedAuthenticationTypesAsync(): Promise<
|
|
31
|
+
export async function supportedAuthenticationTypesAsync(): Promise<
|
|
32
|
+
AuthenticationType[]
|
|
33
|
+
> {
|
|
32
34
|
if (!expoLocalAuthentication.supportedAuthenticationTypesAsync) {
|
|
33
|
-
throw new UnavailabilityError(
|
|
35
|
+
throw new UnavailabilityError(
|
|
36
|
+
NATIVE_MODULE_NAME,
|
|
37
|
+
'supportedAuthenticationTypesAsync',
|
|
38
|
+
);
|
|
34
39
|
}
|
|
35
40
|
return expoLocalAuthentication.supportedAuthenticationTypesAsync();
|
|
36
41
|
}
|
|
@@ -72,7 +77,8 @@ export async function authenticateAsync(
|
|
|
72
77
|
|
|
73
78
|
if (options.promptMessage !== undefined) {
|
|
74
79
|
invariant(
|
|
75
|
-
typeof options.promptMessage === 'string' &&
|
|
80
|
+
typeof options.promptMessage === 'string' &&
|
|
81
|
+
options.promptMessage.length > 0,
|
|
76
82
|
'LocalAuthentication.authenticateAsync: `options.promptMessage` must be a non-empty string.',
|
|
77
83
|
);
|
|
78
84
|
}
|
|
@@ -17,11 +17,15 @@ export type INativeLocalAuthenticationModule = {
|
|
|
17
17
|
isEnrolledAsync?(): Promise<boolean>;
|
|
18
18
|
getEnrolledLevelAsync?(): Promise<SecurityLevel>;
|
|
19
19
|
authenticateAsync?(
|
|
20
|
-
options: ILocalAuthenticationOptions & {
|
|
20
|
+
options: ILocalAuthenticationOptions & {
|
|
21
|
+
promptMessage: string;
|
|
22
|
+
cancelLabel: string;
|
|
23
|
+
},
|
|
21
24
|
): Promise<ILocalAuthenticationResult>;
|
|
22
25
|
cancelAuthenticate?(): Promise<void>;
|
|
23
26
|
};
|
|
24
27
|
|
|
25
|
-
export const expoLocalAuthentication =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
export const expoLocalAuthentication =
|
|
29
|
+
requireNativeModule<INativeLocalAuthenticationModule>(
|
|
30
|
+
EXPO_LOCAL_AUTHENTICATION_MODULE_NAME,
|
|
31
|
+
);
|
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/local-auth/react: the React entry over the framework-agnostic core.
|
|
2
|
-
// Upstream ships free async functions and two enums, no per-instance state and no event
|
|
3
|
-
// stream (unlike the sensor family in @symbiote-native/sensors) — there is nothing for a hook
|
|
4
|
-
// to wrap, so this is a plain re-export, mirroring how Pedometer's free functions pass through
|
|
5
|
-
// packages/sensors/src/react/index.ts 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/local-auth/svelte: the Svelte entry over the framework-agnostic core.
|
|
2
|
-
// Upstream ships free async functions and two enums, no per-instance state and no event stream
|
|
3
|
-
// (unlike the sensor family in @symbiote-native/sensors) — there is nothing for a rune to wrap,
|
|
4
|
-
// so this is a plain re-export. Svelte's lifecycle bucket is `runes/` (adapters/svelte/src/runes
|
|
5
|
-
// — never React's `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/local-auth/react: the React entry over the framework-agnostic core.
|
|
2
|
-
// Upstream ships free async functions and two enums, no per-instance state and no event
|
|
3
|
-
// stream (unlike the sensor family in @symbiote-native/sensors) — there is nothing for a hook
|
|
4
|
-
// to wrap, so this is a plain re-export, mirroring how Pedometer's free functions pass through
|
|
5
|
-
// packages/sensors/src/react/index.ts untouched.
|
|
6
|
-
export * from '../core';
|
package/src/svelte/index.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @symbiote-native/local-auth/svelte: the Svelte entry over the framework-agnostic core.
|
|
2
|
-
// Upstream ships free async functions and two enums, no per-instance state and no event stream
|
|
3
|
-
// (unlike the sensor family in @symbiote-native/sensors) — there is nothing for a rune to wrap,
|
|
4
|
-
// so this is a plain re-export. Svelte's lifecycle bucket is `runes/` (adapters/svelte/src/runes
|
|
5
|
-
// — never React's `hooks` or Vue's `composables`), and this package has none to fill.
|
|
6
|
-
export * from '../core';
|
package/src/vue/index.ts
DELETED