/** Base class for all Ore errors. Use `instanceof OreError` to catch any Ore-originated error. */ export declare class OreError extends Error { constructor(message: string, opts?: ErrorOptions); static is(err: unknown): err is OreError; } /** Thrown when Ore API is called incorrectly (e.g. outside setup, duplicate define, invalid prop). */ export declare class OreApiError extends OreError { } /** * Thrown when an internal invariant fails — e.g. compiled template metadata no * longer matching the DOM it was cloned from. Distinct from `OreApiError`: this * is never the caller's fault, it signals a bug in ore itself. See `invariant()`. */ export declare class OreInternalError extends OreError { } /** * The phase in which a component error occurred. * - `'setup'` — synchronous setup() threw * - `'mounted'` — an onMounted callback threw * - `'form-reset'` — an onFormReset callback threw * - `'each-reconcile'` — `each()` failed to reconcile a list update (e.g. duplicate keys) */ export type OreErrorPhase = 'each-reconcile' | 'form-reset' | 'mounted' | 'setup'; /** * Structured error thrown by the Ore runtime when component setup fails. * Provides component name and original cause for debugging. */ export declare class OreLifecycleError extends OreError { readonly component: string; readonly phase: OreErrorPhase; constructor(message: string, options: { cause: Error; component: string; phase: OreErrorPhase; }); } /** * Report a runtime error via the ore:error event and console. * * `target` only needs to be an `EventTarget` (not specifically an `HTMLElement`) — component * lifecycle errors dispatch on the host element, but non-lifecycle failures (e.g. `each()` * reconciliation, which has no single "component" to attribute the error to) dispatch on * whatever live DOM node is available, such as the directive's own anchor `Comment`. Either way * the event still bubbles and crosses shadow boundaries (`composed: true`), so a listener on * `document`/`window` observes every report regardless of where it originated. * * The console log (via `_dev.ts`'s `error()`) is still dev-gated like the rest of the package's * console diagnostics, but the `ore:error` DOM event dispatch below is **not** — it fires in * every build, so consumers always have a way to observe runtime failures programmatically even * when console output is stripped in production. */ export declare function reportRuntimeError(error: OreLifecycleError, target: EventTarget): void; /** Thrown by `flush()` in the testing sub-path when pending component work doesn't settle within the timeout. */ export declare class OreTimeoutError extends OreError { } export declare const ORE_ERRORS: { readonly asyncSetupUnsupported: "setup() must return an HTMLResult or null; use reactive state for asynchronous work"; readonly defineDuplicate: (tag: string) => string; readonly defineFieldRequiresFormAssociated: (tag: string) => string; readonly defineRequiresTag: "define() requires a tag name"; readonly eachDuplicateKey: (key: string, index: number) => string; readonly eventModifiersUnsupported: (eventName: string) => string; readonly injectStrictFailed: (key: string, tag: string) => string; readonly invariantViolated: (message: string) => string; readonly lifecycleOutsideSetup: "Lifecycle hooks must be called during component setup"; readonly listenNullTarget: (eventName: string) => string; readonly propInvalidReflect: "Structured props cannot use reflect:true — use prop.json() with reflect:false"; readonly templateInterpolationInTag: "html`...`: interpolations inside a tag must be named attributes, boolean attributes, events, or refs"; readonly useFieldAlreadyCalled: (tag: string) => string; readonly validationFailed: (tag: string, errors: string[]) => string; }; /** * Assert an internal invariant that must always hold — e.g. compiled template * metadata staying in sync with the DOM it was cloned from. A failed invariant * means a bug in ore itself, never user input, so it throws `OreInternalError` * unconditionally (every build, never gated like `_dev.ts`'s `warn()`). * * Narrowing caveat: `asserts condition` only narrows the exact expression * passed in. Assign to a local `const` first — `invariant(el.parentNode, msg)` * does not narrow later reads of `el.parentNode`. */ export declare function invariant(condition: unknown, message: string): asserts condition; //# sourceMappingURL=errors.d.ts.map