src/types
declarative-hex-worlds / src/types
src/types
src/types/ — typed primitives shared across every sub-package.
Two flavours live here:
- Unbranded enumerations + interfaces (this file): edition taxonomies, category lists, asset bounds, coordinate shapes. Cross-domain vocabulary that doesn't need nominal typing.
- Branded primitives (
./brands): opaque string IDs (HexKey,ActorId,TileId, etc.) re-exported below. Branding is being introduced progressively per PRD Epic R; the brand surface lives here so the migration touches one file per brand.
Interfaces
AssetBounds
Defined in: packages/declarative-hex-worlds/src/types/index.ts:118
Axis-aligned model bounds extracted from GLTF accessor min/max values.
Properties
max
max: readonly [
number,number,number]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:122
Maximum x/y/z coordinate in model-local units.
min
min: readonly [
number,number,number]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:120
Minimum x/y/z coordinate in model-local units.
size
size: readonly [
number,number,number]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:124
Width, height, and depth derived from max - min.
HexagonGameboardShape
Defined in: packages/declarative-hex-worlds/src/types/index.ts:287
Hexagonal board shape supported by grid, recipe, and seeded generation.
Properties
kind
kind:
"hexagon"
Defined in: packages/declarative-hex-worlds/src/types/index.ts:289
Shape discriminator.
radius
radius:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:291
Radius in rings around the origin.
HexCoordinates
Defined in: packages/declarative-hex-worlds/src/types/index.ts:253
Axial flat-top hex coordinate.
Properties
q
q:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:255
Axial q column.
r
r:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:257
Axial r row.
MedievalHexagonAsset
Defined in: packages/declarative-hex-worlds/src/types/index.ts:151
One renderable GLTF asset with normalized taxonomy, paths, bounds, and material metadata.
Properties
bounds
bounds:
AssetBounds
Defined in: packages/declarative-hex-worlds/src/types/index.ts:179
Extracted model bounds used by fit checks and camera framing.
bufferPaths
bufferPaths: readonly
string[]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:173
Package-relative buffer paths referenced by the GLTF.
category
category:
"tiles"|"buildings"|"decoration"|"units"
Defined in: packages/declarative-hex-worlds/src/types/index.ts:157
Top-level KayKit category.
edition
edition:
"free"|"extra"
Defined in: packages/declarative-hex-worlds/src/types/index.ts:155
Source edition that owns this asset.
faction?
optionalfaction?:"blue"|"green"|"red"|"yellow"
Defined in: packages/declarative-hex-worlds/src/types/index.ts:163
Faction color when the asset is faction-specific.
family
family:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:161
Variant family with faction/style suffixes removed where applicable.
fileSizeBytes
fileSizeBytes:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:181
Size of the source GLTF JSON file in bytes.
id
id:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:153
Stable asset id, normally the GLTF file name without extension.
materialSlots
materialSlots: readonly
string[]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:177
Material names discovered from the GLTF.
modelPath
modelPath:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:169
Package-relative or consumer-resolved model path.
sourcePath
sourcePath:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:171
Source-relative path inside the ingested GLTF tree.
subcategory
subcategory:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:159
Category-specific folder segment, such as roads, blue, or nature.
texturePaths
texturePaths: readonly
string[]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:175
Package-relative texture paths referenced by the GLTF.
textureSet
textureSet:
"default"|"fall"|"summer"|"winter"
Defined in: packages/declarative-hex-worlds/src/types/index.ts:167
Texture palette expected by the asset.
unitStyle?
optionalunitStyle?:"neutral"|"accent"|"full"
Defined in: packages/declarative-hex-worlds/src/types/index.ts:165
Unit recolor style when the asset belongs to units.
MedievalHexagonManifest
Defined in: packages/declarative-hex-worlds/src/types/index.ts:199
Complete normalized asset manifest for one source edition.
Properties
assets
assets: readonly
MedievalHexagonAsset[]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:211
Ordered asset records.
assetsById
assetsById:
Readonly<Record<string,MedievalHexagonAsset>>
Defined in: packages/declarative-hex-worlds/src/types/index.ts:213
Asset lookup by stable id.
counts
counts:
MedievalHexagonManifestCounts
Defined in: packages/declarative-hex-worlds/src/types/index.ts:215
Derived counts for audit and UI summaries.
edition
edition:
"free"|"extra"
Defined in: packages/declarative-hex-worlds/src/types/index.ts:205
Source edition represented by this manifest.
generatedAt
generatedAt:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:203
Stable generation timestamp used by reproducible package assets.
schemaVersion
schemaVersion:
"1.0.0"
Defined in: packages/declarative-hex-worlds/src/types/index.ts:201
Manifest schema version.
sourcePack
sourcePack:
SourcePackInfo
Defined in: packages/declarative-hex-worlds/src/types/index.ts:207
Attribution and source-pack provenance.
textureSets
textureSets: readonly (
"default"|"fall"|"summer"|"winter")[]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:209
Texture palettes present in this edition.
MedievalHexagonManifestCounts
Defined in: packages/declarative-hex-worlds/src/types/index.ts:187
Manifest asset counts grouped for audit, package validation, and docs.
Properties
byCategory
byCategory:
Record<string,number>
Defined in: packages/declarative-hex-worlds/src/types/index.ts:191
Counts keyed by top-level category.
bySubcategory
bySubcategory:
Record<string,number>
Defined in: packages/declarative-hex-worlds/src/types/index.ts:193
Counts keyed as category/subcategory.
total
total:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:189
Total number of GLTF model records.
RectangleGameboardShape
Defined in: packages/declarative-hex-worlds/src/types/index.ts:275
Rectangular board shape supported by grid, recipe, and seeded generation.
Properties
height
height:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:281
Number of rows.
kind
kind:
"rectangle"
Defined in: packages/declarative-hex-worlds/src/types/index.ts:277
Shape discriminator.
width
width:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:279
Number of columns.
SourcePackInfo
Defined in: packages/declarative-hex-worlds/src/types/index.ts:130
Attribution and provenance for one KayKit source pack edition.
Properties
creator
creator:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:138
Asset creator credited by NOTICE.md and generated manifests.
edition
edition:
"free"|"extra"
Defined in: packages/declarative-hex-worlds/src/types/index.ts:136
Edition represented by the manifest.
license
license:
"CC0-1.0"
Defined in: packages/declarative-hex-worlds/src/types/index.ts:140
SPDX-style license identifier for KayKit assets.
licenseUrl
licenseUrl:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:142
Canonical license URL.
name
name:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:132
Human-readable pack name.
sourceRootName
sourceRootName:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:144
Local source directory name used during ingest.
version
version:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:134
Source pack version.
VariantSelection
Defined in: packages/declarative-hex-worlds/src/types/index.ts:233
Result of mapping an arbitrary guide edge mask to a canonical asset and rotation.
Properties
assetId
assetId:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:239
Asset id that should be rendered.
canonicalMask
canonicalMask:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:243
Canonical edge bitmask represented by the selected asset.
family
family:
"road"|"river"|"coast"
Defined in: packages/declarative-hex-worlds/src/types/index.ts:235
Variant family being selected.
inputMask
inputMask:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:241
User-requested edge bitmask before canonicalization.
label
label:
string
Defined in: packages/declarative-hex-worlds/src/types/index.ts:237
Guide label such as A, B, or crossing_A.
rotationRadians
rotationRadians:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:247
Rotation in radians for renderers.
rotationSteps
rotationSteps:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:245
Clockwise 60-degree rotation steps to apply.
WorldPosition
Defined in: packages/declarative-hex-worlds/src/types/index.ts:263
Three-dimensional world-space position used by gameboard plans and renderers.
Properties
x
x:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:265
Horizontal x coordinate.
y
y:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:267
Vertical y coordinate.
z
z:
number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:269
Horizontal z coordinate.
Type Aliases
ActorId
ActorId =
Branded<"ActorId">
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:33
Stable identifier for an authored actor (NPC, player, prop, projectile).
AssetCategory
AssetCategory = typeof
ASSET_CATEGORIES[number]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:82
Top-level source-pack category for a manifest asset.
AssetId
AssetId =
Branded<"AssetId">
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:57
Stable identifier for an asset entry in a manifest.
Branded
Branded<
TBrand> =string&object
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:24
Internal helper: a phantom-typed string distinguishable by its brand tag.
Consumers should reference the exported branded types directly
(HexKey, ActorId, …), not this generic.
Type Declaration
[___brand]
readonly[___brand]:TBrand
Phantom marker that gives this string nominal identity at the type level.
Type Parameters
TBrand
TBrand extends string
Faction
Faction = typeof
FACTIONS[number]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:92
KayKit faction color identifier.
GameboardShape
GameboardShape =
RectangleGameboardShape|HexagonGameboardShape
Defined in: packages/declarative-hex-worlds/src/types/index.ts:297
Serializable board shape supported by grid, recipe, and seeded generation.
HexEdgeIndex
HexEdgeIndex =
0|1|2|3|4|5
Defined in: packages/declarative-hex-worlds/src/types/index.ts:222
Clockwise flat-top hex edge index, starting from the library's canonical edge zero.
HexEdgeInput
HexEdgeInput =
HexEdgeIndex| readonlyHexEdgeIndex[] |number
Defined in: packages/declarative-hex-worlds/src/types/index.ts:227
Edge input accepted by selector and rule helpers.
HexKey
HexKey =
Branded<"HexKey">
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:30
Stringified hex coordinate of the form "q,r" — e.g. "3,-2".
ObjectiveId
ObjectiveId =
Branded<"ObjectiveId">
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:51
Stable identifier for a quest objective inside a quest.
PackEdition
PackEdition = typeof
PACK_EDITIONS[number]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:72
Manifest edition. free assets are published with the package; extra
assets are local-only and come from the ignored ingest source.
PatrolRouteId
PatrolRouteId =
Branded<"PatrolRouteId">
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:54
Stable identifier for a patrol route attached to one or more actors.
PieceId
PieceId =
Branded<"PieceId">
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:39
Stable identifier for a piece declaration in the registry.
PlacementId
PlacementId =
Branded<"PlacementId">
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:42
Stable identifier for a placement instance (a piece dropped onto a tile).
QuestId
QuestId =
Branded<"QuestId">
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:48
Stable identifier for a quest (with objectives) attached to a scenario.
ScenarioId
ScenarioId =
Branded<"ScenarioId">
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:45
Stable identifier for a scenario document.
TextureSet
TextureSet = typeof
TEXTURE_SETS[number]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:113
Texture palette identifier. The FREE pack only ships default; EXTRA ingest
can add fall, summer, and winter variants.
TileId
TileId =
Branded<"TileId">
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:36
Stable identifier for a tile placement on the board grid.
UnitStyle
UnitStyle = typeof
UNIT_STYLES[number]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:102
Unit style taxonomy for neutral units and EXTRA faction recolors.
Variables
ASSET_CATEGORIES
constASSET_CATEGORIES: readonly ["tiles","buildings","decoration","units"]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:77
Top-level source-pack category used by KayKit's GLTF folder structure.
FACTIONS
constFACTIONS: readonly ["blue","green","red","yellow"]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:87
Faction color variants used by KayKit buildings, flags, and units.
GAMEBOARD_SCHEMA_VERSION
constGAMEBOARD_SCHEMA_VERSION:"1.0.0"='1.0.0'
Defined in: packages/declarative-hex-worlds/src/types/index.ts:56
Schema version written to generated gameboard plans.
Lives here (and not in src/gameboard/) so trait declarations under
src/traits/ can reference it without importing the gameboard module
at runtime — which would re-enter the same dependency cycle that R2's
decomposition is meant to keep linear (traits → types, never
traits → gameboard).
HEX_WORLDS_SCHEMA_VERSION
constHEX_WORLDS_SCHEMA_VERSION:"1.0.0"='1.0.0'
Defined in: packages/declarative-hex-worlds/src/types/index.ts:45
Current manifest schema emitted by the ingest CLI and bundled FREE manifest.
KAYKIT_PACK_VERSION
constKAYKIT_PACK_VERSION:"1.0"='1.0'
Defined in: packages/declarative-hex-worlds/src/types/index.ts:61
KayKit Medieval Hexagon pack version represented by this package.
PACK_EDITIONS
constPACK_EDITIONS: readonly ["free","extra"]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:66
Asset editions understood by manifests and package helpers.
TEXTURE_SETS
constTEXTURE_SETS: readonly ["default","fall","summer","winter"]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:107
Texture palettes exposed by the FREE and EXTRA source packs.
UNIT_STYLES
constUNIT_STYLES: readonly ["neutral","accent","full"]
Defined in: packages/declarative-hex-worlds/src/types/index.ts:97
KayKit EXTRA unit style variants.
Functions
brandActorId()
brandActorId(
value):ActorId
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:64
Brand a string as an ActorId. Caller must validate.
Parameters
value
string
Returns
brandAssetId()
brandAssetId(
value):AssetId
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:96
Brand a string as an AssetId. Caller must validate.
Parameters
value
string
Returns
brandHexKey()
brandHexKey(
value):HexKey
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:60
Brand a string as a HexKey. Caller must validate.
Parameters
value
string
Returns
brandObjectiveId()
brandObjectiveId(
value):ObjectiveId
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:88
Brand a string as an ObjectiveId. Caller must validate.
Parameters
value
string
Returns
brandPatrolRouteId()
brandPatrolRouteId(
value):PatrolRouteId
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:92
Brand a string as a PatrolRouteId. Caller must validate.
Parameters
value
string
Returns
brandPieceId()
brandPieceId(
value):PieceId
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:72
Brand a string as a PieceId. Caller must validate.
Parameters
value
string
Returns
brandPlacementId()
brandPlacementId(
value):PlacementId
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:76
Brand a string as a PlacementId. Caller must validate.
Parameters
value
string
Returns
brandQuestId()
brandQuestId(
value):QuestId
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:84
Brand a string as a QuestId. Caller must validate.
Parameters
value
string
Returns
brandScenarioId()
brandScenarioId(
value):ScenarioId
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:80
Brand a string as a ScenarioId. Caller must validate.
Parameters
value
string
Returns
brandTileId()
brandTileId(
value):TileId
Defined in: packages/declarative-hex-worlds/src/types/brands.ts:68
Brand a string as a TileId. Caller must validate.
Parameters
value
string
