index.d.ts 587 B

12345678910111213141516171819
  1. import { PiniaPluginContext } from 'pinia';
  2. export interface PersistStrategy {
  3. key?: string;
  4. storage?: Storage;
  5. paths?: string[];
  6. }
  7. export interface PersistOptions {
  8. enabled: true;
  9. strategies?: PersistStrategy[];
  10. }
  11. declare type Store = PiniaPluginContext['store'];
  12. declare module 'pinia' {
  13. interface DefineStoreOptionsBase<S, Store> {
  14. persist?: PersistOptions;
  15. }
  16. }
  17. export declare const updateStorage: (strategy: PersistStrategy, store: Store) => void;
  18. declare const _default: ({ options, store }: PiniaPluginContext) => void;
  19. export default _default;