import type { GetType } from "purify-ts";
import { Codec, Either } from "purify-ts";
declare const codecs: {
    "sk-widget@1//skPubKeys": Codec<Record<string, string>>;
    "sk-widget@1//shimDisconnect/tron": Codec<boolean>;
    "sk-widget@1//shimDisconnect/solana": Codec<boolean>;
    "sk-widget@1//shimDisconnect/substrate": Codec<boolean>;
    "sk-widget@1//shimDisconnect/cardano": Codec<boolean>;
    "sk-widget@1//substrateConnectors/lastConnectedId": Codec<string>;
    "sk-widget@1//cardanoConnectors/lastConnectedWallet": Codec<{
        address: string;
        id: string;
    } | null>;
    "sk-widget@1//tosAccepted": Codec<boolean>;
};
export type LocalStorageKV = {
    [Key in keyof typeof codecs]: GetType<(typeof codecs)[Key]>;
};
type LocalStorageValue<K extends keyof LocalStorageKV> = GetType<(typeof codecs)[K]>;
export declare const getStorageItem: <K extends keyof LocalStorageKV>(key: K) => Either<Error, LocalStorageValue<K> | null>;
export declare const setStorageItem: <K extends keyof LocalStorageKV>(key: K, value: GetType<(typeof codecs)[K]>) => Either<Error, void | undefined>;
type Listener<K extends keyof LocalStorageKV = keyof LocalStorageKV> = (val: GetType<(typeof codecs)[K]>) => void;
export declare const addLocalStorageListener: <K extends keyof LocalStorageKV>(key: K, listener: Listener<K>) => () => boolean;
export {};
