import { AtomEffect } from 'recoil'; /** * Recoil atom effect that provides `LocalStorage` or `SessionStorage` persistence. * * Stores the state in storage using `JSON.stringify`. **Please ensure that * the state returned is valid as this can be edited by users in DevTools.** * * Defaults to storing in `window.localStorage`. * * @param key Key name for the state in storage * @param storage (optional) Either `localStorage` or `sessionStorage` * @param validator (optional) A function which accepts a data object retrieved from storage and returns whether it should be loaded as the state (is valid) * * @example Persist Recoil state under 'my-state-in-LS' key * atom({ * key: 'myState', * default: { data: null }, * effects_UNSTABLE: [storageEffect('my-state-in-LS')] * }) */ export declare function storageEffect(key: string, storage?: Storage | undefined, validator?: (data: T) => boolean): AtomEffect;