/** * App / plugin LIFECYCLE hook registry — an App concern. * * The Runtime is the dispatch substrate; it does not know about plugins or a * boot/shutdown lifecycle. The App owns that, so the lifecycle slots * (`App*` / `Plugin*`) live here, on a per-App `AppHooks` registry that * `AppLifecycle` fires from. Each slot is a `Hook` accessed as a * typed property on the registry. * * The slots are declared by augmenting the `AppHooks` interface exported from * `@nwire/runtime` (the same forward-declaration pattern forge uses for the * runtime's `FrameworkHooks`), so `PluginContext.on` / `PluginContext.defineHook` * stay typed against them. * * Lifecycle hooks still emit `hook.step` telemetry: `AppLifecycle` wires every * slot through `runtime.observe(...)`, the same tap the runtime's own hooks use, * so Studio's plugin live-tap (`hook.step`) keeps working. */ import { type Hook } from "@nwire/hooks"; import type { PluginKind } from "@nwire/runtime"; declare module "@nwire/runtime" { interface AppHooks { AppRegistering: Hook<{ readonly appName: string; }>; AppBooting: Hook<{ readonly appName: string; }>; AppBooted: Hook<{ readonly appName: string; readonly bootedAt: string; }>; AppReady: Hook<{ readonly appName: string; readonly readyAt: string; }>; AppShuttingDown: Hook<{ readonly appName: string; readonly reason?: string; }>; AppShutdown: Hook<{ readonly appName: string; }>; PluginRegistered: Hook<{ readonly appName: string; readonly pluginName: string; readonly kind?: PluginKind; }>; PluginBooting: Hook<{ readonly appName: string; readonly pluginName: string; readonly kind?: PluginKind; }>; PluginBooted: Hook<{ readonly appName: string; readonly pluginName: string; readonly durationMs: number; readonly kind?: PluginKind; }>; PluginShuttingDown: Hook<{ readonly appName: string; readonly pluginName: string; readonly kind?: PluginKind; }>; PluginShutdown: Hook<{ readonly appName: string; readonly pluginName: string; readonly durationMs: number; readonly kind?: PluginKind; }>; } } export type { AppHooks } from "@nwire/runtime"; /** Canonical names for the built-in lifecycle slots — labels the underlying Hooks. */ declare const BUILT_IN_APP_HOOK_NAMES: { readonly AppRegistering: "nwire.app.registering"; readonly AppBooting: "nwire.app.booting"; readonly AppBooted: "nwire.app.booted"; readonly AppReady: "nwire.app.ready"; readonly AppShuttingDown: "nwire.app.shutting-down"; readonly AppShutdown: "nwire.app.shutdown"; readonly PluginRegistered: "nwire.plugin.registered"; readonly PluginBooting: "nwire.plugin.booting"; readonly PluginBooted: "nwire.plugin.booted"; readonly PluginShuttingDown: "nwire.plugin.shutting-down"; readonly PluginShutdown: "nwire.plugin.shutdown"; }; export type AppHookSlot = keyof typeof BUILT_IN_APP_HOOK_NAMES; /** * Construct a per-App lifecycle registry with every built-in slot * pre-instantiated. Plugin-defined lifecycle slots added via * `ctx.defineHook(name)` land on the same registry instance. */ export declare function createAppHooks(): import("@nwire/runtime").AppHooks; /** True if `slot` is one of the built-in app lifecycle hook keys. */ export declare function isAppHook(slot: string): slot is AppHookSlot;