UNPKG

@ocubist/error-alchemy

Version:

A powerful Node.js error-handling-framework with custom error types for easy debugging, enhanced error management, strong zod-support and useful quality-of-life-functionality for asserting and validating values.

73 lines 2.67 kB
/// <reference types="node" /> declare const craftMysticError: (props: { name: string; severity?: import("../../..").Severity | undefined; cause?: string | undefined; errorCode?: import("../../..").ErrorCode | undefined; }) => { new (props: { message: string; origin?: unknown; payload?: Record<string, unknown> | undefined; }): { dynamicClassUuid: string; instanceUuid: string; name: string; severity: import("../../..").Severity; origin?: unknown; cause?: string | undefined; payload: Record<string, unknown>; module?: string | undefined; context?: string | undefined; errorCode: import("../../..").ErrorCode; readonly severityDescription: string; readonly simpleGetter: string; readonly identifier: string; message: string; stack?: string | undefined; }; compare(err: unknown): boolean; captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void; prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; stackTraceLimit: number; }; /** * Type for AssertFalsyFailedError. */ export type AssertFalsyFailedError = InstanceType<ReturnType<typeof craftMysticError>>; export declare const AssertFalsyFailedError: { new (props: { message: string; origin?: unknown; payload?: Record<string, unknown> | undefined; }): { dynamicClassUuid: string; instanceUuid: string; name: string; severity: import("../../..").Severity; origin?: unknown; cause?: string | undefined; payload: Record<string, unknown>; module?: string | undefined; context?: string | undefined; errorCode: import("../../..").ErrorCode; readonly severityDescription: string; readonly simpleGetter: string; readonly identifier: string; message: string; stack?: string | undefined; }; compare(err: unknown): boolean; captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void; prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; stackTraceLimit: number; }; export type Falsy<T> = T extends false | "" | 0 | null | undefined ? T : never; /** * Asserts that a given value is falsy. * @param {T} value - The value to be checked for falsiness. * @throws {AssertFalsyFailedError} If the value is truthy. */ export declare function assertFalsy<T>(value: T): asserts value is Falsy<T>; export {}; //# sourceMappingURL=assertFalsy.d.ts.map