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.
56 lines (43 loc) • 1.77 kB
TypeScript
import { PiniaPlugin, PiniaPluginContext, Store } from 'pinia';
import { EppsConstructorProps } from '../plugins/epps';
import { ExtendedStateOptions } from '../plugins/extendedState';
import { CollectionState, CollectionStoreMethods, DefineEppsStore, ExtendedState } from './store';
export interface AnyObject {
[key: number | string | symbol]: any;
}
export interface SearchCollectionCriteria {
[key: number | string | symbol]: boolean | number | string;
}
export type {
AugmentOptionApiStore,
AugmentStore,
CollectionState,
CollectionStoreMethods,
DefineExtendedStore,
DefineExtendedStoreOptionApi,
EppsStore,
ExtendState,
ExtendedStore,
PersistedState,
PersistedStore
} from "./store";
declare module 'epps' {
export function createPlugin(dbName: string, cryptIv?: string, cryptKey?: string): PiniaPlugin;
export function createPluginMock(dbName: string, cryptIv?: string, cryptKey?: string): PiniaPlugin;
export function defineEppsStore<TStore, TState>(id: string, storeDefinition: () => AnyObject): DefineEppsStore<TStore, TState>
export function defineStoreId(prefix: string, id: string): string
export class Epps {
constructor({ dbName, dbKeyPath, cryptIv, cryptKey }: EppsConstructorProps)
plugin(context: PiniaPluginContext): void
}
export function extendedState(
parentsStores: Store[],
options?: ExtendedStateOptions
): ExtendedState;
export function getParentStorePropertyValue(
propertyName: string,
parentStore: AnyObject | string | number | undefined,
parentsStores?: Store[]
): any;
export function useCollectionStore<T>(id: string): Store & CollectionState<T> & CollectionStoreMethods;
}