import type { DappSession } from './dappSession.ts'; import type { DappError } from './lifecycle.ts'; import type { DappStatus } from './status.ts'; export declare const DappLaunchErrorCode: { readonly failed: "dapp-launch.failed"; readonly stopped: "dapp-launch.stopped"; readonly statusIdentityChanged: "dapp-launch.status-identity-changed"; readonly statusInvalid: "dapp-launch.status-invalid"; }; export interface DappLaunchOwnedResource { stop(): Promise; } export interface DappBootContext { readonly whenStopRequested: Promise; isStopRequested(): boolean; own(resource: DappLaunchOwnedResource): void; planned(planId: string): void; provisioned(systemInstanceId: string): void; recovered(): void; throwIfStopRequested(): void; } export interface LaunchDappOptions { readonly boot: (context: DappBootContext) => Promise>; readonly mapError?: (cause: unknown) => DappError; /** Supplies changing health/convergence dimensions with planning-phase identity. */ readonly readStatus: () => DappStatus; } export interface DappLaunchReady { readonly launchId: string; readonly outcome: 'ready'; readonly session: DappSession; readonly systemInstanceId: string; } export interface DappLaunchStopped { readonly launchId: string; readonly outcome: 'stopped'; } export interface DappLaunchFailed { readonly cause: unknown; readonly error: DappError; readonly launchId: string; readonly outcome: 'failed'; } export type DappLaunchResult = DappLaunchFailed | DappLaunchReady | DappLaunchStopped; export interface DappLaunch>> { readonly outcome: Promise>; status(): DappStatus; stop(): Promise; whenReady(): Promise>; } export declare class DappLaunchStoppedError extends Error { readonly code: "dapp-launch.stopped"; readonly launchId: string; constructor(launchId: string); } export declare class DappLaunchFailedError extends Error { readonly code: "dapp-launch.failed"; readonly dappError: DappError; readonly launchId: string; constructor(launchId: string, dappError: DappError, cause: unknown); } export declare class DappLaunchStatusError extends Error { readonly code: string; constructor(code: string, message: string); } export declare function launchDapp(options: LaunchDappOptions): DappLaunch; //# sourceMappingURL=dappLaunch.d.ts.map