UNPKG

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.

19 lines (18 loc) 1.16 kB
import { CollectionState } from "../types"; export interface IError { id: string; level?: number; message: string; } export interface ErrorsState<TError extends IError = IError> { errors: TError[]; } export interface ErrorsStore<TError extends IError = IError> { addError: (error: TError) => void; clearErrors: () => void; getError: (errorId: string) => TError | undefined; getErrors: (value?: boolean | number | string, findBy?: string) => TError[]; hasError: (level?: number) => boolean; removeError: (criteria: Partial<TError>) => void; } export declare const useErrorsStore: <TError extends IError = IError>(id: string) => Partial<ErrorsStore<IError>> & Partial<CollectionState<TError>> & Partial<import("../types").PersistedState> & Partial<import("../types").PersistedStore> & import("pinia")._StoreWithState<string, {}, {}, {}> & {} & {} & import("pinia").PiniaCustomProperties<string, {}, {}, {}> & import("pinia").PiniaCustomStateProperties<{}> & import("pinia").PiniaCustomProperties<string, import("pinia").StateTree, import("pinia")._GettersTree<import("pinia").StateTree>, import("pinia")._ActionsTree>;