/** * Safe unwrapping of `unknown` catch values. * * A `catch` binding is `unknown` — touching `.message` on it is unsound, and * `String(error)` on a plain object yields the useless `"[object Object]"`. * This is the one canonical unwrap for the whole fleet. */ /** * Mask credentials before they reach a toast or the clipboard. * * `showError` displays this text AND copies it, so anything here can end up in a * screenshot or pasted into a GitHub issue. A thrown HTTP/SDK error routinely * carries `authorization` headers, `x-api-key`, or a token in a URL — the * 2026-07-25 check found a realistic Anthropic 401 shape putting a live * `sk-ant-…` key into both. * * Mirrors the redaction in `@chrismessina/raycast-logger`, deliberately: the two * packages protect the same secrets from the same payloads. */ export declare function redactSecrets(text: string): string; /** * Turn any thrown value into a human-readable string. * * Replaces the hand-written `error instanceof Error ? error.message : String(error)` * ternary (98 occurrences across 16 extensions as of 2026-07-25), and additionally * handles the cases that bare ternary gets wrong. * * @example * getErrorMessage(new Error("Boom")) // "Boom" * getErrorMessage("just a string") // "just a string" * getErrorMessage({ message: "from API" }) // "from API" * getErrorMessage(null) // "An unknown error occurred." * getErrorMessage({ a: 1 }) // '{"a":1}' — never "[object Object]" */ export declare function getErrorMessage(error: unknown): string; /** * `true` when the value is an abort/cancellation rather than a real failure. * * Aborted requests are the single most common false-positive failure toast: a * user types another keystroke, the in-flight `AbortController` fires, and the * `catch` shows an error for something that worked exactly as designed. * `AbortController` appears in 8 extensions, so this guard is load-bearing. * * @example * try { await fetch(url, { signal }); } * catch (error) { if (!isAbortError(error)) await showError(error, { title: "Search failed" }); } */ export declare function isAbortError(error: unknown): boolean; //# sourceMappingURL=errors.d.ts.map