import type { ClientRuntime, ClientRuntimeApp, ClientRuntimePage } from "../../shared/runtime-config.js"; export interface AppModule { init?: (ctx: AppContext) => void | Promise; mount?: (mountPoint: Element, ctx: AppContext) => void | Promise; hydrate?: (mountPoint: Element, ctx: AppContext) => void | Promise; unmount?: (mountPoint: Element, ctx: AppContext) => void | Promise; } export type ShellModuleRegistration = AppModule | ((ctx: AppContext) => AppModule | Promise); export interface AppContext { id: string; kind: "app" | "page"; runtime: ClientRuntime; output: ClientRuntimeApp | ClientRuntimePage; request: ActivationRequest; } export interface ActivationRequest { appId?: string; pageId?: string; buildId?: string; url?: string | URL; mountPoint?: Element; hydrate?: boolean; } export interface ShellOptions { runtime: ClientRuntime; drivers?: ShellDriver[]; loadModule?: (href: string, ctx: AppContext) => Promise; resolveMountPoint?: (ctx: AppContext) => Element | null; onError?: (error: unknown, ctx: ShellErrorContext) => void | Promise; } export interface ShellErrorContext { phase: "resolve" | "load" | "init" | "mount" | "hydrate" | "unmount"; app: AppContext; } export interface Shell { start(request?: ActivationRequest): Promise; activate(request: ActivationRequest): Promise; preload(request: ActivationRequest): Promise; dispose(): Promise; } export interface ShellDriver { current(): ActivationRequest; subscribe?(callback: (request: ActivationRequest) => void): () => void; } export interface PageDriverOptions { document?: Document; } export interface PageDriver extends ShellDriver { } export interface HistoryDriverOptions { runtime: ClientRuntime; window?: BrowserWindowLike; } export interface HistoryDriver extends ShellDriver { subscribe(callback: (request: ActivationRequest) => void): () => void; } export type BrowserWindowLike = Pick; export interface ResolvedShellTarget { id: string; href: string; ctx: AppContext; } //# sourceMappingURL=types.d.ts.map