/** Constructor for `Cancel` instances. */ interface CancelConstructor { prototype: Cancel; /** * Creates a Cancel instance. * Can be called as a function or with `new`. * * @param message the cancellation message */ (message?: string): Cancel; /** * Creates a Cancel instance. * Can be called as a function or with `new`. * * @param message the cancellation message */ new (message?: string): Cancel; } /** * Represents cancellation errors. */ interface Cancel { /** Error name is `AbortError` for compatibility with JavaScript's AbortSignal handling. */ name: "AbortError"; /** User defined message. */ message: string | undefined; /** `cancelled` is always true for instances of `Cancel`. */ cancelled: true; /** Returns `"Cancel: "` */ toString(): string; } /** * Creates a Cancel instance. * Can be called as a function or with `new`. * * @param message the cancellation message */ declare const Cancel: CancelConstructor; /** * Returns true if the given error represents a cancellation error. * This is the case if it is either an instance of `Cancel` or * a plain error with name `AbortError`. */ declare function isCancellationError(error: any): boolean; export { Cancel, Cancel as default, isCancellationError }; export type { CancelConstructor };