/** * Options for every `BasaltError` — the standard `cause`, plus an optional * structured payload. */ export interface BasaltErrorOptions extends ErrorOptions { /** * Machine-readable data about this failure, for the caller to act on: * which checks failed, how much quota is left, the current version behind a * conflict. Without it the only place to put that data is the human-readable * message, and the UI ends up parsing sentences. * * When the error carries a numeric `status`, `@basaltkit/http` serialises a * sanitised copy of this as `error.details` in the HTTP body — so treat it as * PUBLIC: no secrets, no internals, plain JSON data only, and small. See the * rules in `@basaltkit/http`'s "Structured error details". */ details?: Record; } /** * Base error for the whole ecosystem. The `code` is stable and part of the * semver contract — apps can safely branch on codes. */ export declare class BasaltError extends Error { readonly code: string; /** Structured payload passed to the constructor, exactly as given (never sanitised here). */ readonly details?: Record; constructor(code: string, message: string, options?: BasaltErrorOptions); } export declare class ContextUnavailableError extends BasaltError { constructor(); } export declare class UnknownTokenError extends BasaltError { constructor(description: string); } export declare class CircularDependencyError extends BasaltError { constructor(chain: string[]); } /** * A `scoped` token was resolved while a `singleton` was being built. The * singleton outlives every scope, so it would permanently capture ONE scope's * instance (e.g. request 1's per-request service served to every later * request) — the classic captive dependency. Fails loudly instead of * capturing silently. Inject the scope-dependent service per call (resolve it * from `ctx().container` at use time), or make the dependency transient. */ export declare class CaptiveDependencyError extends BasaltError { constructor(scopedToken: string, singletonToken: string); } export declare class PluginDependencyError extends BasaltError { constructor(message: string); } export declare class ConfigValidationError extends BasaltError { readonly plugin: string; readonly issues: unknown; constructor(plugin: string, issues: unknown); } export declare class LifecycleError extends BasaltError { constructor(message: string); }