import { BiometricKey } from "../../auth/types/biometric-key"; import { Account } from "../models/domain/account"; import { StorageOptions } from "../models/domain/storage-options"; /** * Options for customizing the initiation behavior. */ export type InitOptions = { /** * Whether or not to run state migrations as part of the init process. Defaults to true. * * If false, the init method will instead wait for migrations to complete before doing its * other init operations. Make sure migrations have either already completed, or will complete * before calling {@link StateService.init} with `runMigrations: false`. */ runMigrations?: boolean; }; export abstract class StateService { addAccount: (account: T) => Promise; clean: (options?: StorageOptions) => Promise; init: (initOptions?: InitOptions) => Promise; /** * Gets the user's auto key */ getUserKeyAutoUnlock: (options?: StorageOptions) => Promise; /** * Sets the user's auto key */ setUserKeyAutoUnlock: (value: string, options?: StorageOptions) => Promise; /** * Gets the user's biometric key */ getUserKeyBiometric: (options?: StorageOptions) => Promise; /** * Checks if the user has a biometric key available */ hasUserKeyBiometric: (options?: StorageOptions) => Promise; /** * Sets the user's biometric key */ setUserKeyBiometric: (value: BiometricKey, options?: StorageOptions) => Promise; /** * @deprecated For backwards compatible purposes only, use DesktopAutofillSettingsService */ setEnableDuckDuckGoBrowserIntegration: ( value: boolean, options?: StorageOptions, ) => Promise; /** * @deprecated For migration purposes only, use getUserKeyMasterKey instead */ getEncryptedCryptoSymmetricKey: (options?: StorageOptions) => Promise; /** * @deprecated For migration purposes only, use setUserKeyAuto instead */ setCryptoMasterKeyAuto: (value: string, options?: StorageOptions) => Promise; getDuckDuckGoSharedKey: (options?: StorageOptions) => Promise; setDuckDuckGoSharedKey: (value: string, options?: StorageOptions) => Promise; /** * @deprecated Use `TokenService.hasAccessToken$()` or `AuthService.authStatusFor$` instead. */ getIsAuthenticated: (options?: StorageOptions) => Promise; /** * @deprecated Use `AccountService.activeAccount$` instead. */ getUserId: (options?: StorageOptions) => Promise; }