import { PiniaPluginContext } from 'pinia'; import sunshineStorage from 'sunshine-storage'; interface IOptions { suffix?: string; prefix?: string; } interface IBasePersist { key?: string; paths?: string[]; beforeRestore?: (context: PiniaPluginContext) => void; afterRestore?: (context: PiniaPluginContext) => void; debug?: boolean; } interface IPersist extends IBasePersist { storage?: Storage; type?: 'storage' | 'db'; } interface IExtendPersist extends IBasePersist { storage: ReturnType; } type TPersist = boolean | IPersist; declare module 'pinia' { interface DefineStoreOptionsBase { persist?: TPersist; } interface PiniaCustomProperties { $hydrate: (opts?: { runHooks?: boolean; }) => void; $persist: () => void; } } declare const plugin: (context: PiniaPluginContext, _options?: IOptions) => void; declare const createPlugin: (options: IOptions) => (context: PiniaPluginContext) => void; export { type IBasePersist, type IExtendPersist, type IOptions, type IPersist, type TPersist, createPlugin, plugin as default, plugin };