/** * @copyright Sister Software. * @license AGPL-3.0 * @author Teffen Ellis, et al. */ import type { StatusCodes } from "http-status-codes"; /** * Type-helper to extract the status code from a `ResourceError`. */ export type ExtractResourceErrorStatusCode = T extends ResourceError ? S : never; declare const kResourceError = "_kResourceError"; /** * An entity registered with the Federal Communications Commission (FCC) that provides telecommunications services. */ export declare class ResourceError extends Error { static DefaultStatus: number; static DefaultMessage: string; [kResourceError]: boolean; static [Symbol.hasInstance](input: unknown): input is ResourceError; static from(statusCode: S, message: string, ...urnSegments: string[]): ResourceError; /** * Given an error, wraps it in a ResourceError instance. */ static wrap(error: E, message?: string, ...urnSegments: string[]): E extends ResourceError ? ResourceError : ResourceError; /** * Given a possible instance of `Error`, wraps it in a `ResourceError` instance. * * Note that if the error is already an instance of `ResourceError`, it will be returned as-is. */ static wrap(error: unknown, message?: string, ...urnSegments: string[]): ResourceError; get [Symbol.toStringTag](): string; /** * @title HTTP status code. * * A numeric status code conforming to the HTTP standard. */ status: S; /** * @title Error message. * * A human-readable error message explaining the error. */ message: string; /** * @title URN identifier. * * A unique identifier for the error, used to reference it in logs and other systems. * * @format uri */ name: string; constructor(status: S | undefined, urn: string, message?: string); toJSON(): { name: string; status: S; message: string; }; toString(): string; } /** * @public * @title Resource Error * * An error response from a resource, such as an API, database, or file. */ export type ResourceErrorSchema = Pick; export {}; //# sourceMappingURL=schema.d.ts.map