import type { StoredState } from "../store/types.js"; import type { AlchemyAccountsConfig } from "../types.js"; /** * Function to create cookie based Storage * * @param {{sessionLength: number; domain?: string}} config optional config object * @param {number} config.sessionLength the duration until the cookie expires in milliseconds (deprecated) * @param {string} config.domain optional domain to set the cookie on, eg: `example.com` if you want the cookie to work on all subdomains of example.com * @returns {Storage} an instance of a browser storage object that leverages cookies */ export declare const cookieStorage: (config?: { /** @deprecated this option is deprecated and will be ignored */ sessionLength?: number; domain?: string; }) => Storage; /** * Converts a cookie into an initial state object * * @param {AlchemyAccountsConfig} config the account config containing the client store * @param {string | undefined} cookie optional cookie string * @returns {StoredState | undefined} the deserialized AlchemyClientState if the cookie exists, otherwise undefined */ export declare function cookieToInitialState(config: AlchemyAccountsConfig, cookie?: string): StoredState | undefined; /** * Helper function that can be used to parse a cookie string on the server or client * * @param {string} cookie the cookie string to parse * @param {string} key the key of the cookie to parse * @returns {string} the value of the cookie given a key if it exists, otherwise undefined */ export declare function parseCookie(cookie: string, key: string): string | undefined;