import type { WireComponent } from './component.js'; /** * Base class for all adowire server-side exceptions. * * Thrown during the request lifecycle (boot, hydrate, property update, * action call, or dehydrate). Caught by `WireRequestHandler` which calls * the component's `exception()` hook before deciding whether to re-throw. */ export declare class WireException extends Error { /** * The component instance that was being processed when the error occurred. * May be undefined if the error happened before the component was resolved. */ readonly component?: WireComponent; /** * The lifecycle phase in which the error occurred. */ readonly phase?: WireLifecyclePhase; constructor(message: string, options?: { component?: WireComponent; phase?: WireLifecyclePhase; cause?: unknown; }); /** * Wrap any unknown thrown value into a `WireException`. * If the value is already a `WireException`, it is returned as-is. */ static wrap(err: unknown, options?: { component?: WireComponent; phase?: WireLifecyclePhase; }): WireException; } /** * Thrown when the HMAC checksum on an incoming snapshot does not match. * This typically means the snapshot was tampered with on the client, or the * `APP_KEY` was rotated between requests. * * Results in a 403 response — never re-rendered. */ export declare class ChecksumException extends WireException { constructor(message?: string); } /** * Thrown when the request handler cannot find a registered component for the * name stored in the snapshot memo. * * Results in a 404 response. */ export declare class ComponentNotFoundException extends WireException { readonly componentName: string; constructor(componentName: string); } /** * Thrown when the client attempts to update a property decorated with `@Locked`. * * Results in a 403 response. */ export declare class LockedPropertyException extends WireException { readonly propertyName: string; constructor(propertyName: string, component?: WireComponent); } /** * Thrown when the client attempts to call a method that is not publicly * callable (fails the `$isCallable()` guard). * * Results in a 403 response. */ export declare class MethodNotCallableException extends WireException { readonly methodName: string; constructor(methodName: string, component?: WireComponent); } /** * Thrown when an error occurs during Edge.js template rendering. */ export declare class RenderException extends WireException { readonly viewName: string; constructor(viewName: string, cause: unknown, component?: WireComponent); } /** * The phase of the component lifecycle in which an error occurred. */ export type WireLifecyclePhase = 'boot' | 'mount' | 'hydrate' | 'updating' | 'action' | 'dehydrate' | 'render' | 'unknown';