export type OpenfortErrorOptions = { /** Underlying error this one wraps. Always surfaced as `error.cause`. */ cause?: Error | undefined; /** Low-level explanation appended as `Details:`. Inherited from an `OpenfortError` cause. */ details?: string | undefined; /** Path appended to {@link OpenfortError.docsBaseUrl} to build a `Docs:` link. */ docsPath?: string | undefined; /** Extra lines rendered between the short message and the docs link. */ metaMessages?: string[] | undefined; }; /** * Base class for every error the SDK produces. * * `message` is composed from the short message, meta messages, a docs link, the * details of the underlying failure and the SDK version, so a pasted stack trace * carries enough context to diagnose the problem without a reproduction. */ export declare class OpenfortError extends Error { /** Low-level explanation of the failure, usually the wrapped error's message. */ details: string; /** Path under {@link docsBaseUrl} documenting this failure, when one exists. */ docsPath?: string | undefined; /** Extra context lines rendered under the short message. */ metaMessages?: string[] | undefined; /** * The message passed to the constructor, without the composed context. * * Compare against this rather than `message`. `message` carries a version * footer, so it changes every release — matching on it breaks on upgrade, and * grouping reports by it produces a fresh fingerprint per SDK version. */ shortMessage: string; name: string; get docsBaseUrl(): string; get version(): string; constructor(shortMessage: string, options?: OpenfortErrorOptions); /** * Walks the `cause` chain and returns the first error matching `fn`. * * Without a predicate it returns the deepest cause; when nothing matches it * returns the deepest cause too, so the result is never `undefined`. Callers * looking for a specific error must re-test the returned value. */ walk(fn?: (err: unknown) => boolean): unknown; } /** * Coerces an unknown thrown value into an `Error` so it can be used as a `cause`. * * `catch` binds `unknown`, but rejections are not always `Error` instances — * strings and plain objects both show up in practice. */ export declare function toError(value: unknown): Error; /** * Wraps an unknown thrown value with `wrap`, passing through values that are * already Openfort errors. * * Use this where a failure has already been classified deeper in the stack and * the outer layer adds nothing; where the outer layer does add context, wrap * unconditionally with `{ cause: toError(value) }` instead so both messages survive. */ export declare function asOpenfortError(cause: unknown, wrap: (cause: Error) => OpenfortError): OpenfortError; /** * The one-line message a UI should render for `error`. * * An `OpenfortError`'s `message` is the composed multi-line block ending in a * `Version:` footer — for logs and reports, not for a modal. Rendering surfaces * use the short message and fall back through the parts that stay one line. */ export declare function toDisplayMessage(error: unknown): string;