@martinmilo/verve
Version:
TypeScript domain modeling library with field-level authorization, business rule validation, and context-aware access control
20 lines • 724 B
TypeScript
import { ErrorCode } from "./codes";
export declare class VerveError extends Error {
constructor(code: ErrorCode, ...args: any[]);
is(code: ErrorCode): boolean;
static getMessage(code: ErrorCode, ...args: any[]): string;
static getMessageWithCode(code: ErrorCode, ...args: any[]): string;
}
export declare class VerveErrorList {
private readonly errors;
static new(): VerveErrorList;
count(): number;
add(code: ErrorCode, ...args: any[]): void;
merge(errors: VerveErrorList): void;
contains(code: ErrorCode): boolean;
isEmpty(): boolean;
isPresent(): boolean;
toErrorMessages(): string[];
toErrorMessagesWithCode(): string[];
}
//# sourceMappingURL=VerveError.d.ts.map