import type { GameContextEntityEntry } from "../runtime/gameContext.js"; import { type ParamSchema } from "../scene/sceneKinds.js"; import type { EditorCatalogData, EditorCatalogDefinition } from "./types.js"; /** * Well-known catalog id for authored entity definitions. A `mob`/`boss` marker's `catalogId` * references an entry (row) in this catalog, and {@link entityEntryFromCatalog} turns that row into * the runtime {@link GameContextEntityEntry} a spawn consumes — so an entity's stats and speed are * authored in the editor Data tab, not hardcoded in game TS. */ export declare const ENTITY_CATALOG_ID = "entities"; /** * The default {@link ParamSchema} for an authored entity definition — role, health, movement speed, * and visual scale. Drives the editor Data-tab inspector for the `entities` catalog and is the shape * {@link entityEntryFromCatalog} reads. A game exports it as an `editorCatalogs` schema; the scaffold * ships a starter one so the tab is never empty. * @capability editor-entities Author entity stats/movement per catalog row instead of hardcoding TS. */ export declare const entityDefinitionSchema: ParamSchema; /** Minimal document shape {@link entityEntryFromCatalog} reads — any `EditorDocument` satisfies it. */ export interface EntityCatalogDocumentLike { catalogs: readonly EditorCatalogData[]; } /** * Turns an authored entity row into the runtime {@link GameContextEntityEntry} a spawn consumes: * looks up `entityId` in the document's {@link ENTITY_CATALOG_ID} catalog (falling back to the * game-exported `definitions` defaults), parses it against {@link entityDefinitionSchema}, and maps * the fields onto stats/movement/role. Returns `null` when no row defines the entity, so the default * `content.ts` path can chain other resolvers. The single seam that makes "place a mob, tune its * stats/speed in the editor, save — it spawns with those stats" work with zero game code. * @capability editor-entities Consume authored entity definitions from the scene document at runtime. */ export declare function entityEntryFromCatalog(document: EntityCatalogDocumentLike, entityId: string, definitions?: readonly EditorCatalogDefinition[]): GameContextEntityEntry | null; /** * Merges game-exported catalog definitions with editor-authored ones carried on the scene document. * A document catalog that carries its own `schema` and has no matching game definition is synthesized * into a full {@link EditorCatalogDefinition} (label falls back to the id) so the Data panel, the * `list_catalogs` RPC, and the count all see it. A game definition always wins on id collision — its * schema lives in code and is authoritative. Document catalogs without a schema (plain value bags for * a game-declared catalog) are ignored here; they are addressed through their game definition. * @capability editor-catalogs Merge game-exported and editor-authored catalogs into one addressable set. */ export declare function resolveCatalogDefinitions(document: EntityCatalogDocumentLike, gameDefinitions: readonly EditorCatalogDefinition[]): EditorCatalogDefinition[];