/** * Whether this runtime can distinguish Proxy values without evaluating a trap. * Callers that need a fail-closed guarantee must not treat a `false` result * from {@link isProxyWithoutHooks} as proof when this capability is absent. */ export declare const canIdentifyProxyWithoutHooks: boolean; /** True when own stack descriptors can be inspected without formatting them. */ export declare const canInspectErrorStackDescriptorWithoutHooks: boolean; /** * Read a native Error's stack without letting project code observe the read. * * Data-valued stacks are returned directly. An accessor is only invoked when it * is the runtime's own getter, and then only with `Error.prepareStackTrace` * shadowed; any other accessor fails closed rather than running foreign code. * * Materializing a lazy stack makes the runtime format the error header, which * reads `name` and `message`. Both must therefore resolve to data properties, * or the read is skipped rather than allowed to trigger a project accessor. */ export declare function readNativeErrorStackWithoutHooks(error: Error): string | undefined; /** * Identify native Error values without evaluating project-owned Proxy traps. */ export declare function isNativeErrorWithoutHooks(value: unknown): value is Error; /** * Identify an Error whose prototype chain may have been minted somewhere else. * * `value instanceof Error` compares against the `Error.prototype` of whichever * realm this module was evaluated in. An Error produced in a worker, a `vm` * context, or a second instance of this module graph — which the Node and Bun * loaders both produce, one per package copy or per transpiled entry — carries * a different `Error.prototype` and fails that comparison even though it is a * genuine Error. Code that branches on `instanceof` to decide whether to keep * an error therefore discards real errors at exactly those boundaries. * * The native brand check reads the runtime's own `[[ErrorData]]` internal slot, * which no realm boundary changes, so it recognizes those errors. `instanceof` * stays as a second branch because Bun does not report `DOMException` as a * native error, and a DOMException — the shape every unattributed `AbortSignal` * cancellation reason takes — must keep being recognized there. * * Values that merely look like errors (a plain object carrying `name` and * `message`, or one tagged `[object Error]` through `Symbol.toStringTag`) are * rejected by both branches, so this stays a brand check rather than a shape * check. * * Unlike {@link isNativeErrorWithoutHooks} this can run project code: the * `instanceof` branch consults `Symbol.hasInstance`. Callers that must not * execute foreign hooks use the brand check directly. */ export declare function isErrorAcrossRealms(value: unknown): value is Error; /** * Read a native Error's display name without executing instance, prototype, or * constructor accessors. Custom subclasses use their own data-valued * prototype name or constructor name; unreadable/exotic shapes fail closed. */ export declare function readNativeErrorNameWithoutHooks(error: Error): string; /** * Identify a Proxy without evaluating any trap on the proxied value. * * Returns `false` without inspecting `value` when * {@link canIdentifyProxyWithoutHooks} is false. */ export declare function isProxyWithoutHooks(value: unknown): boolean; /** Identify a genuine Uint8Array without evaluating project-owned hooks. */ export declare function isUint8ArrayWithoutHooks(value: unknown): value is Uint8Array; /** Identify a genuine Promise across realms without reading instance fields. */ export declare function isNativePromiseWithoutHooks(value: unknown): value is Promise; /** * Identify native and bound async functions across realms without invoking * project hooks. The descriptor fallback is deliberately conservative because * runtime brand checks do not recognize bound async functions. */ export declare function isNativeAsyncFunctionWithoutHooks(value: unknown): value is (...args: unknown[]) => Promise; //# sourceMappingURL=error-introspection.d.ts.map