// Exposes the WASM `Core` instance through a Svelte context so views // that need its math bridge (Phase 18 ship-class preview, future // inspector calculators) can read it without re-booting the module. // The layout populates `core` after `loadCore()` resolves; consumers // observe `null` while the boot is in flight and the live `Core` // once the runtime is ready. import type { Core } from "../platform/core/index"; /** * CORE_CONTEXT_KEY is the Svelte context key the in-game shell * layout uses to expose its booted `Core` to descendants such as * the ship-class designer preview pane. */ export const CORE_CONTEXT_KEY = Symbol("core"); export interface CoreHandle { readonly core: Core | null; } export class CoreHolder implements CoreHandle { #core: Core | null = $state(null); get core(): Core | null { return this.#core; } set(core: Core | null): void { this.#core = core; } }