import type { StoredState } from "./store/types.js"; import { type AlchemyAccountsConfig } from "./types.js"; export type HydrateResult = { onMount: () => Promise; }; /** * Will hydrate the client store with the provided initial state if one is provided. * * @example * ```ts * import { hydrate, cookieToInitialState } from "@account-kit/core"; * import { config } from "./config"; * * const initialState = cookieToInitialState(document.cookie); * const { onMount } = hydrate(config, initialState); * // call onMount once your component has mounted * ``` * * @param {AlchemyAccountsConfig} config the config containing the client store * @param {StoredState} initialState optional param detailing the initial ClientState * @returns {{ onMount: () => Promise }} an object containing an onMount function that can be called when your component first renders on the client */ export declare function hydrate(config: AlchemyAccountsConfig, initialState?: StoredState): HydrateResult;