import type { GoodVibesTokenStore } from './types.js'; /** * String union of the `SecureStore.ACCESSIBLE_*` constant names. * Resolved by property lookup on the dynamically-imported module so that * numeric native values never need to be hard-coded here. */ export type ExpoSecureStoreAccessible = 'AFTER_FIRST_UNLOCK' | 'AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY' | 'ALWAYS' | 'ALWAYS_THIS_DEVICE_ONLY' | 'WHEN_PASSCODE_SET_THIS_DEVICE_ONLY' | 'WHEN_UNLOCKED' | 'WHEN_UNLOCKED_THIS_DEVICE_ONLY'; export interface ExpoSecureTokenStoreOptions { /** * The key used for the secure-store entry. * @default 'goodvibes-sdk-token' */ readonly key?: string | undefined; /** * iOS Keychain service name. Passed through to `SecureStore.setItemAsync` * as `keychainService`. Has no effect on Android. */ readonly keychainService?: string | undefined; /** * Controls when the stored data is accessible. Maps to the * `SecureStore.ACCESSIBLE_*` constants. * * @default 'WHEN_UNLOCKED_THIS_DEVICE_ONLY' */ readonly accessible?: ExpoSecureStoreAccessible | undefined; } export interface ExpoSecureTokenStore extends GoodVibesTokenStore { /** * Persist a token together with an optional Unix-epoch expiry (ms). * Both values are serialised into a single secure-store entry. * Picked up automatically by the `TokenStore` wrapper via duck-typing. */ setTokenEntry(token: string | null, expiresAt?: number): Promise; /** * Return the stored token and optional expiry timestamp. * Picked up automatically by the `TokenStore` wrapper via duck-typing. */ getTokenEntry(): Promise<{ token: string | null; expiresAt?: number; }>; } /** * Create a `GoodVibesTokenStore` backed by `expo-secure-store`. * * Both the `token` and `expiresAt` values are serialised as a single JSON * blob into one secure-store entry, keeping the keychain tidy. * * `expo-secure-store` is an **optional peer dependency**, install it with: * * ```sh * expo install expo-secure-store * ``` * * @example * ```ts * import { createExpoSecureTokenStore, createExpoGoodVibesSdk } from '@pellux/goodvibes-sdk/expo'; * * const tokenStore = createExpoSecureTokenStore({ key: 'gv-token' }); * const sdk = createExpoGoodVibesSdk({ baseUrl: 'https://daemon.example.com', tokenStore }); * ``` */ export declare function createExpoSecureTokenStore(options?: ExpoSecureTokenStoreOptions, __loadModule?: () => Promise): ExpoSecureTokenStore; //# sourceMappingURL=expo-secure-token-store.d.ts.map