Home
Pages

src/manifest/schema

declarative-hex-worlds

declarative-hex-worlds


declarative-hex-worlds / src/manifest/schema

src/manifest/schema

Manifest schema, normalization, lookup, validation, URL resolution, and bundle helpers for packaged FREE assets plus app-local EXTRA manifests.

Interfaces

CreateManifestBundleOptions

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:115

Options for createManifestBundle.

Properties

duplicatePreference?

optional duplicatePreference?: ManifestDuplicatePreference

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:117

Duplicate resolution strategy. Defaults to last.


KayKitAttribution

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:56

Attribution metadata applied to generated manifests and NOTICE guidance.

Properties

creator

creator: string

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:58

Creator credited by generated manifests and package NOTICE text.

license

license: "CC0-1.0"

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:62

SPDX-style asset license label.

licenseUrl

licenseUrl: string

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:64

Canonical URL for the asset license terms.

website

website: string

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:60

Public creator or KayKit website URL.


ManifestAssetSelection

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:123

Field filters for manifest asset queries.

Properties

categories?

optional categories?: readonly ("tiles" | "buildings" | "decoration" | "units")[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:129

Match top-level categories.

editions?

optional editions?: readonly ("free" | "extra")[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:127

Match source editions.

factions?

optional factions?: readonly ("blue" | "green" | "red" | "yellow")[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:135

Match faction-colored assets.

families?

optional families?: readonly string[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:133

Match normalized asset families.

ids?

optional ids?: readonly string[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:125

Match exact asset ids.

subcategories?

optional subcategories?: readonly string[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:131

Match category-specific subcategories.

textureSets?

optional textureSets?: readonly ("default" | "fall" | "summer" | "winter")[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:139

Match texture palettes.

unitStyles?

optional unitStyles?: readonly ("neutral" | "accent" | "full")[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:137

Match unit styles.


ManifestAssetUrlOptions

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:145

URL resolution options for manifest assets.

Extended by

Properties

baseUrl?

optional baseUrl?: string | URL

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:147

Base URL applied to every model path when no edition-specific base exists.

bootstrapAssetRoot?

optional bootstrapAssetRoot?: string | URL

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:160

Consumer's bootstrap asset root (per PRD RB3).

When set, manifest sourcePath values (e.g. buildings/blue/foo.gltf) are joined with this root to produce the resolved URL — <bootstrapAssetRoot>/<sourcePath> (flat layout, no subdirectory prefix).

Honored only when neither baseUrl nor a matching editionBaseUrls entry is set; explicit base URLs always win.

editionBaseUrls?

optional editionBaseUrls?: Partial<Record<"free" | "extra", string | URL>>

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:149

Per-edition base URLs, useful when FREE is packaged and EXTRA is local.


MedievalHexagonManifestBundle

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:80

Combined view over one or more edition manifests.

Properties

assets

assets: readonly MedievalHexagonAsset[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:92

De-duplicated assets selected according to duplicate preference.

assetsById

assetsById: Readonly<Record<string, MedievalHexagonAsset>>

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:94

De-duplicated asset lookup by id.

counts

counts: MedievalHexagonManifestCounts

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:96

Counts derived from de-duplicated assets.

duplicateAssetIds

duplicateAssetIds: readonly string[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:98

Asset ids that appeared in more than one manifest.

editions

editions: readonly ("free" | "extra")[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:86

Editions present in the bundle.

manifests

manifests: readonly MedievalHexagonManifest[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:84

Normalized source manifests included in the bundle.

schemaVersion

schemaVersion: "1.0.0"

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:82

Bundle schema version.

sourcePacks

sourcePacks: readonly SourcePackInfo[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:90

Source-pack attribution records.

textureSets

textureSets: readonly ("default" | "fall" | "summer" | "winter")[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:88

Texture sets present across all manifests.


MedievalHexagonManifestInspection

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:187

Result of validating and normalizing a manifest-like object.

Properties

errorCount

errorCount: number

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:193

Number of error-severity issues.

issues

issues: readonly MedievalHexagonManifestIssue[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:191

All validation issues.

manifest?

optional manifest?: MedievalHexagonManifest

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:189

Normalized manifest when no errors were found.

warningCount

warningCount: number

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:195

Number of warning-severity issues.


MedievalHexagonManifestIssue

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:171

One manifest validation issue.

Properties

assetId?

optional assetId?: string

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:181

Optional asset id associated with the issue.

code

code: string

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:173

Stable issue code for tests and CLI output.

message

message: string

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:177

Human-readable explanation.

path?

optional path?: string

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:179

Optional JSON path.

severity

severity: MedievalHexagonManifestIssueSeverity

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:175

Whether the issue blocks a normalized manifest.

Type Aliases

ManifestAssetCatalog

ManifestAssetCatalog = MedievalHexagonManifest | MedievalHexagonManifestBundle

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:105

Catalog accepted by lookup helpers: either one edition manifest or a combined FREE/EXTRA bundle.


ManifestDuplicatePreference

ManifestDuplicatePreference = "first" | "last" | "free" | "extra"

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:110

Strategy for resolving duplicate asset ids when combining manifests.


MedievalHexagonManifestIssueSeverity

MedievalHexagonManifestIssueSeverity = "error" | "warning"

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:166

Severity emitted by manifest inspection.

Variables

KAYKIT_ATTRIBUTION

const KAYKIT_ATTRIBUTION: Readonly<KayKitAttribution>

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:70

Canonical attribution metadata for KayKit Medieval Hexagon assets.

Functions

createManifestBundle()

createManifestBundle(manifests, options?): MedievalHexagonManifestBundle

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:261

Combines multiple edition manifests into one lookup catalog.

Parameters

manifests

readonly MedievalHexagonManifest[]

options?

CreateManifestBundleOptions = {}

Returns

MedievalHexagonManifestBundle


getManifestAsset()

getManifestAsset(catalog, assetId): MedievalHexagonAsset | undefined

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:339

Looks up an asset in a manifest or bundle by stable asset id.

Parameters

catalog

ManifestAssetCatalog

assetId

string

Returns

MedievalHexagonAsset | undefined


hasManifestAsset()

hasManifestAsset(catalog, assetId): boolean

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:349

Returns true when a manifest or bundle contains the requested asset id.

Parameters

catalog

ManifestAssetCatalog

assetId

string

Returns

boolean


inspectMedievalHexagonManifest()

inspectMedievalHexagonManifest(input): MedievalHexagonManifestInspection

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:201

Validates an unknown value and returns a normalized manifest when possible.

Parameters

input

unknown

Returns

MedievalHexagonManifestInspection


manifestAssetRequiresExtra()

manifestAssetRequiresExtra(catalog, assetId): boolean

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:356

Returns true for any asset that is not supplied by the published FREE edition.

Parameters

catalog

ManifestAssetCatalog

assetId

string

Returns

boolean


normalizeMedievalHexagonManifest()

normalizeMedievalHexagonManifest(manifest): MedievalHexagonManifest

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:247

Rebuilds manifest indexes, counts, and texture-set ordering from the manifest asset list.

Parameters

manifest

MedievalHexagonManifest

Returns

MedievalHexagonManifest


resolveManifestAssetUrl()

resolveManifestAssetUrl(asset, options?): string

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:363

Resolves a manifest model path against a base URL or a bootstrap asset root.

Parameters

asset

MedievalHexagonAsset

options?

ManifestAssetUrlOptions = {}

Returns

string


rewriteToBootstrapPath()

rewriteToBootstrapPath(asset): string

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:383

Return the asset's path relative to the bootstrap asset root. The manifest's modelPath and sourcePath are equal and already asset-root-relative, so this is an identity pass-through. Consumers resolve the final URL via gameboardAssetUrl(asset) in declarative-hex-worlds/runtime.

Parameters

asset

MedievalHexagonAsset

Returns

string


selectManifestAssets()

selectManifestAssets(catalog, selection?): MedievalHexagonAsset[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:303

Selects manifest assets by id, edition, taxonomy, faction, unit style, or texture set.

Parameters

catalog

ManifestAssetCatalog

selection?

ManifestAssetSelection = {}

Returns

MedievalHexagonAsset[]


validateMedievalHexagonManifest()

validateMedievalHexagonManifest(input): MedievalHexagonManifestIssue[]

Defined in: packages/declarative-hex-worlds/src/manifest/schema.ts:239

Returns only the validation issues for an unknown manifest-like value.

Parameters

input

unknown

Returns

MedievalHexagonManifestIssue[]

References

ASSET_CATEGORIES

Re-exports ASSET_CATEGORIES


AssetBounds

Re-exports AssetBounds


AssetCategory

Re-exports AssetCategory


Faction

Re-exports Faction


FACTIONS

Re-exports FACTIONS


HEX_WORLDS_SCHEMA_VERSION

Re-exports HEX_WORLDS_SCHEMA_VERSION


HexCoordinates

Re-exports HexCoordinates


HexEdgeIndex

Re-exports HexEdgeIndex


HexEdgeInput

Re-exports HexEdgeInput


KAYKIT_PACK_VERSION

Re-exports KAYKIT_PACK_VERSION


MedievalHexagonAsset

Re-exports MedievalHexagonAsset


MedievalHexagonManifest

Re-exports MedievalHexagonManifest


MedievalHexagonManifestCounts

Re-exports MedievalHexagonManifestCounts


PACK_EDITIONS

Re-exports PACK_EDITIONS


PackEdition

Re-exports PackEdition


SourcePackInfo

Re-exports SourcePackInfo


TEXTURE_SETS

Re-exports TEXTURE_SETS


TextureSet

Re-exports TextureSet


UNIT_STYLES

Re-exports UNIT_STYLES


UnitStyle

Re-exports UnitStyle


VariantSelection

Re-exports VariantSelection


WorldPosition

Re-exports WorldPosition