Skip to content

parseAssetSourceSpec

parseAssetSourceSpec(input): object

Defined in: packages/declarative-hex-worlds/src/asset-source/spec.ts:158

Parse + validate a spec, throwing a precise ZodError on invalid input.

unknown

assetRoot: string

Root directory the asset paths are relative to (e.g. “public/assets”).

assets: ({ biome: string; edgeMask?: number; format: "png" | "glb" | "gltf"; id: string; path: string; role: "tile"; } | { biome?: string; format: "png"; grid: { cellHeight: number; cellWidth: number; cols: number; rows: number; }; id: string; path: string; role: "tileset"; transition?: { edgeCells: Record<string, number>; }; } | { category?: "unit" | "prop" | "structure" | "npc" | "enemy" | "pc" | "encounter"; format: "png"; id: string; path: string; role: "sprite"; } | { category?: "unit" | "prop" | "structure" | "npc" | "enemy" | "pc" | "encounter"; format: "glb" | "gltf"; id: string; path: string; role: "model"; })[]

Ordered asset records.

name: string

Human-readable source name (e.g. “kaykit-free”, “my-tileset-pack”).

specVersion: 1

Spec format version (this schema is v1).