//#region src/@types/common.d.ts type EncryptAlgorithms = 'AES-GCM' | 'AES-CBC' | 'AES-CTR'; type StorageType = 'localStorage' | 'sessionStorage'; type ChangeNotifyType = 'set' | 'set:cookie' | 'get' | 'get:cookie' | 'getMultiple' | 'setMultiple' | 'remove' | 'remove:cookie' | 'removeMultiple' | 'clear' | 'length' | 'key'; interface NotifyHandlerParams { type: ChangeNotifyType; key?: string | string[]; value?: ValueType; index?: number; } type NotifyHandler = (params: NotifyHandlerParams) => void; interface RemoveFromPatternOptions { exact?: boolean; } interface GetFromPatternOptions extends RemoveFromPatternOptions { multiple?: boolean; doNotDecrypt?: boolean; } interface SetItemWithTTLParams { /** * @description Key name */ key: string; /** * @description Value */ value: any; /** * @description Do not encrypt */ doNotEncrypt?: boolean; /** * @description Time to live */ ttl: number | Date; } interface CookieOptions { expires?: number | Date; path?: string; domain?: string; secure?: boolean; sameSite?: 'strict' | 'lax' | 'none'; } interface SyncCookieInterface { /** * @description Set cookie * @param {string} key * @param {any} value * @param {CookieOptions} options * @returns {void} `void` */ set(key: string, value: any, options?: CookieOptions): void; /** * @description Get cookie * @param {string} key * @returns {DataType | null} `DataType | null` */ get(key: string): DataType | null; /** * @description Remove cookie * @param {string} key * @param {RemoveCookieOptions} options * @returns {void} `void` */ remove(key: string, options?: RemoveCookieOptions): void; } interface AsyncCookieInterface { /** * @description Set cookie * @param {string} key * @param {any} value * @param {CookieOptions} options * @returns {Promise} `Promise` */ set(key: string, value: any, options?: CookieOptions): Promise; /** * @description Get cookie * @param {string} key * @returns {Promise} `Promise` */ get(key: string): Promise; /** * @description Remove cookie * @param {string} key * @param {RemoveCookieOptions} options * @returns {void} `void` */ remove(key: string, options?: RemoveCookieOptions): Promise; } interface RemoveCookieOptions { path?: string; domain?: string; } /** * @description Validation options for encrypt storage setValue validate */ interface ValidationInterface { /** * @description Whether `null` values are allowed. * When disabled, attempting to store `null` throws `NullValueError`. * Null don't cause invalid JSON serialization, but can cause unexpected behavior. * @default true */ allowNull?: boolean; /** * @description Whether `undefined` values are allowed. * When disabled, attempting to store `undefined` throws `UndefinedValueError`. * This prevents invalid JSON serialization. * @default false */ allowUndefined?: boolean; /** * @description Whether strict mode is enabled. * When enabled, the `allowNull` and `allowUndefined` options are ignored and `null` and `undefined` values are not allowed. * @default false */ strict?: boolean; } interface BaseEcnryptStorageOptions { /** * @description EncryptStorage encrypt algorithm * @default 'AES-GCM' */ encAlgorithm?: EncryptAlgorithms; /** * @description Prefix to be added to all keys * @default '' */ prefix?: string; /** * @description Enable state management * @default false */ stateManagementUse?: boolean; /** * @description Storage you want to use * @default localStorage */ storageType?: StorageType; /** * @description Not encrypt values * @default false */ doNotEncryptValues?: boolean; /** * @description Not parse values * @default false */ doNotParseValues?: boolean; /** * @description Notify handler * @default undefined */ notifyHandler?: NotifyHandler; /** * @description Validation options * @default undefined */ validation?: ValidationInterface; } interface SyncEncryptStorageOptions extends BaseEcnryptStorageOptions { /** * @description Encrypt engine * @default 'noble' */ engine: 'noble'; } interface AsyncEncryptStorageOptions extends BaseEcnryptStorageOptions { /** * @description Encrypt engine * @default 'web-api' */ engine: 'web-crypto' | 'noble'; } type EncryptStorageOptions = AsyncEncryptStorageOptions | SyncEncryptStorageOptions; //#endregion export { AsyncCookieInterface, AsyncEncryptStorageOptions, BaseEcnryptStorageOptions, ChangeNotifyType, CookieOptions, EncryptAlgorithms, EncryptStorageOptions, GetFromPatternOptions, NotifyHandler, NotifyHandlerParams, RemoveCookieOptions, RemoveFromPatternOptions, SetItemWithTTLParams, StorageType, SyncCookieInterface, SyncEncryptStorageOptions, ValidationInterface }; //# sourceMappingURL=common.d.mts.map