import type { TokenStorage } from '../shared/types'; type StorageOptions = { /** * The name of the file (without extension) used to persist tokens. * * @default 'clerk-tokens' */ name?: string; /** * The directory in which the token file is stored. Maps to `electron-store`'s `cwd` option. * When omitted, the OS default user config directory is used. */ path?: string; /** * When OS-level encryption is unavailable (e.g. a Linux machine without a keyring), tokens are * not persisted by default, which signs the user out on the next app launch. Set this to `true` * to instead persist tokens **unencrypted** in that scenario, keeping the user signed in across * restarts at the cost of storing tokens in plaintext on disk. * * @default false */ unencryptedFallback?: boolean; }; /** * Creates a secure {@link TokenStorage} adapter for the Electron main process. * * Tokens are persisted with `electron-store` and encrypted at rest using Electron's * {@link safeStorage} API, which is backed by the OS keystore (Keychain on macOS, DPAPI on * Windows, libsecret/kwallet on Linux). It uses Electron 42's async `safeStorage` API only when it * reports itself available (which generally requires a code-signed app) and otherwise falls back to * the synchronous API. Pass the result to `createClerkBridge({ storage: storage() })`. * * Behavior is secure by default: when OS encryption is unavailable the adapter does not persist * tokens (the user will be signed out on restart) unless {@link StorageOptions.unencryptedFallback} * is enabled. Undecryptable entries return `null`. * * @example * ```ts * import { createClerkBridge } from '@clerk/electron'; * import { storage } from '@clerk/electron/storage'; * * createClerkBridge({ storage: storage({ name: 'my-app-tokens' }) }); * ``` */ export declare function storage(options?: StorageOptions): TokenStorage; export {}; //# sourceMappingURL=index.d.ts.map