/** * The WindowState phase machine (API §10) — the lifecycle of a hosted view as the * React face observes it. Distinct from the shell's own `WindowState` * (`active|hidden|closing|closed`): this is the phase a `ViewHost`/`AppHost` * renders around. */ /** * Lifecycle of a hosted view as the React face observes it (API §10). * * `crashed.windowId` is OPTIONAL: a crash before a window exists (a session-open * failure, a pre-mount source-resolution failure) has no id to report — the type * says so rather than carrying a placeholder `''`. */ export type WindowState = | { readonly phase: 'mounting' } | { readonly phase: 'ready'; readonly windowId: string } | { readonly phase: 'crashed'; readonly windowId?: string; readonly error?: unknown } | { readonly phase: 'closed'; readonly windowId: string; readonly refusal?: string }