import { GetFromPatternOptions, RemoveFromPatternOptions, SetItemWithTTLParams, SyncCookieInterface } from "./common.cjs"; //#region src/@types/encrypt-storage-crypto-noble.d.ts interface EncryptStorageNobleApiInterface extends Storage { /** * `setItem` - Is the function to be set `safeItem` in `selected storage` * @param {string} key - Is the key of `data` in `selected storage`. * @param {any} value - Value to be `encrypted`, the same being a `string` or `object`. * @return {void} `void` * @example * encryptStorage.setItem('any_key', {key: 'value', another_key: 2}); * encryptStorage.setItem('any_key', 'any value'); */ setItem(key: string, value: any, doNotEncrypt?: boolean): void; /** * `setItemWithTTL` - Is the function to set an `safeItem` with `ttl` in `selected storage` * @param {SetItemWithTTLParams} params - Is de `params` of function. * @return {void} `void` * @example * encryptStorage.setItemWithTTL({ * key: 'any_key', * value: { key: 'value', another_key: 2 }, * ttl: 60, // in seconds or Date * }); */ setItemWithTTL?: (params: SetItemWithTTLParams) => void; /** * `setMultipeItems` - Is the function to be set `safeItem` in `selected storage` * @param {[string, any][]} param - . * @param {any} value - It's an `array` of `tuples` to be set at once... * @return {void} `void` * @example * encryptStorage.setItem(['any_key', {key: 'value', another_key: 2}]) * encryptStorage.setItem(['any_key', 'any value']) */ setMultipleItems(param: [string, any][], doNotEncrypt?: boolean): void; /** * `hash` - Is the function to be `hash` value width SHA256 encryptation * @param {any} value - Value to be `hashed`, the same being a `string`. * @return {string} `hashed string` * @example * encryptStorage.hash('any_string') */ hash(value: string): string; /** * `getItem` - Is the function to be get `safeItem` in `selected storage` * @param {string} key - Is the key of `data` in `selected storage`. * @return {string | any | undefined} - Returns a formatted value when the same is an object or string when not. * Returns `undefined` when value not exists. * @example * encryptStorage.getItem('any_key') -> `{key: 'value', another_key: 2}` * encryptStorage.getItem('any_key') -> `'any value'` */ getItem(key: string, doNotDecrypt?: boolean): string | any | null; /** * `getMulpleItems` - Is the function to be get `safeItems` in `selected storage` * @param {string[]} keys - Is the keys of `data` in `selected storage`. * @return {Record | undefined} - Returns a formatted value when the same is an object or string when not. * Returns `undefined` when value not exists. * @example * encryptStorage.getMultipleItems(['any_key']) -> `{any_key: {key: 'value', another_key: 2}}` * encryptStorage.getMultipleItems(['any_key']) -> `{any_key: 'any value'}` */ getMultipleItems(keys: string[], doNotDecrypt?: boolean): Record; /** * `removeItem` - Is the function to be remove `safeItem` in `selected storage` * @param {string} key - Is the key of `data` in `selected storage`. * @return {void} * Returns `void`. * @example * encryptStorage.removeItem('any_key') */ removeItem(key: string): void; /** * `removeMultipleItems` - Is the function to be remove `safeItems` in `selected storage` * @param {string[]} keys - Is the keys of `data` in `selected storage`. * @return {void} * Returns `void`. * @example * encryptStorage.removeMultipleItems(['any_key_1'm 'any_key_2']) */ removeMultipleItems(keys: string[]): void; /** * `getItemFromPattern` - Is the function to be get `safeItem` in `selected storage` from `pattern` based * @param {string} pattern - Is the pattern existent in keys of `selected storage`. * @return {any | Record | undefined} * Returns `void`. * @example * // itemKey = '12345678:user' * // another itemKey = '12345678:item' * encryptStorage.getItemFromPattern('12345678'); // -> {'12345678:user': 'value', '12345678:item': 'otherValue'} */ getItemFromPattern(pattern: string, options?: GetFromPatternOptions): Record | any | undefined; /** * `removeItemFromPattern` - Is the function to be remove `safeItem` in `selected storage` from `pattern` based * @param {string} pattern - Is the pattern existent in keys of `selected storage`. * @return {void} * Returns `void`. * @example * // itemKey = '12345678:user' * // another itemKey = '12345678:item' * encryptStorage.removeItem('12345678'); // -> item removed from `selected storage` */ removeItemFromPattern(pattern: string, options?: RemoveFromPatternOptions): void; /** * `clear` - Clear all selected storage * @example * encryptStorage.clear(); */ clear(): void; /** * `key` - Return a `key` in selected storage index or `null` * @param {number} index - Index of `key` in `selected storage` * @example * encryptStorage.key(0); // -> 'any_key' */ key(index: number): string | null; /** * `encryptValue` - Is the function to be `encrypt` any value and return encrypted value * @param {string} value - A `value|object|array` to be encrypted. * @return {string} result * Returns `string`. * @example * encryptStorage.encryptString('any_string'); // -> 'encrypted value' */ encryptValue(value: any): string; /** * `decryptString` - Is the function to be `decrypt` any value encrypted by `encryptValue` and return decrypted value * @param {string} value - A `value|object|array` to be decrypted. * @return {DataType|any} result * Returns `string`. * @example * encryptStorage.decryptString('any_value'); // -> '{value: "decrypted value"}' */ decryptValue(value: string): DataType | null; cookie: SyncCookieInterface; } //#endregion export { EncryptStorageNobleApiInterface }; //# sourceMappingURL=encrypt-storage-crypto-noble.d.cts.map