import type { Error as Auth0Error } from '@auth0/auth0-acul-js'; export interface ErrorItem extends Auth0Error { id: string; label?: string; type?: ErrorType; } export type ErrorType = 'auth0' | 'validation' | 'configuration'; export declare const ERROR_TYPES: ErrorType[]; type Bucket = { auth0: ReadonlyArray; validation: ReadonlyArray; configuration: ReadonlyArray; }; type Listener = () => void; /** * Global error store for ACUL (one screen per page). * - Holds a single bucket of errors across the current page. * - Generates stable ids for every inserted error. * - Emits immutable snapshots to subscribers. */ declare class ErrorStore { private bucket; private listeners; subscribe(cb: Listener): () => void; snapshot(): Readonly; /** Add ids and freeze an array of ErrorItem-like objects. */ private normalize; /** Replace an entire type with a new list (generating ids if needed). */ replace(type: ErrorType, list: Array | ErrorItem>): void; /** * Replace only errors for a specific field within a type. * - Keeps all existing errors for other fields. * - Normalizes incoming errors and replaces matching field ones. */ replacePartial(type: ErrorType, list: Array | ErrorItem>, field: string): void; /** Append one or more items to a type. */ push(type: ErrorType, list: Omit | ErrorItem | Array | ErrorItem>): void; /** Clear one or more kinds (default: all kinds). */ clear(kinds?: ErrorType[]): void; /** * Remove errors that match a given id or predicate from specified kinds. */ remove(kinds: ErrorType[] | undefined, test: string | ((e: ErrorItem) => boolean)): void; private notify; } export declare const errorStore: ErrorStore; export {};