epps
Version:
Enhances Pinia stores with advanced features such as persistence, encryption, and store extension. Simplifies state management and ensures data security for Vue.js and Nuxt applications.
29 lines (28 loc) • 1.03 kB
TypeScript
import Crypt from "../services/Crypt";
import Persister from "../services/Persister";
import type { AllowedKeyPath } from "../types/storage";
import type { PiniaPlugin, PiniaPluginContext, StateTree } from "pinia";
import type { PersistedStore } from "../types/store";
export interface EppsConstructorProps {
dbName?: string;
dbKeyPath?: AllowedKeyPath;
cryptKey?: string;
cryptIv?: string;
debug?: boolean;
}
export declare class Epps {
private _db?;
private _debug;
private _crypt?;
private _watchedStore;
get db(): Persister | undefined;
get crypt(): Crypt | undefined;
constructor(db?: Persister, crypt?: Crypt, debug?: boolean);
plugin(context: PiniaPluginContext): void;
rewriteResetStore({ store }: PiniaPluginContext, initState: StateTree): void;
}
export declare function createPlugin(dbName?: string, cryptIv?: string, cryptKey?: string, debug?: boolean): PiniaPlugin;
declare module 'pinia' {
interface PiniaCustomProperties extends PersistedStore {
}
}