the raw (generated) record type
the linked view type returned to callers
the raw (generated) record type
the linked view type returned to callers
Every record, deduplicated by id, in first-seen order.
Number of distinct records.
Look up by exact id within a faction. Use this when an id is shared
across factions (e.g. chaos-land-raider lives under five Chaos factions)
and a faction context is known — get would return whichever copy
was registered first, which may belong to the wrong faction. Returns
undefined when no record with that id belongs to factionId.
Whether a record with this exact id exists.
Find one record by id or name. Name matching is diacritic- and punctuation-insensitive (see normalizeName), trying, in order: exact id → exact normalized name → normalized-name substring. Returns the first match; names can repeat across factions, so use findAll or byFaction when a query may be ambiguous.
All records matching a query, by the same rules as find. An exact id match returns just that record; otherwise every normalized-name-exact match is returned, falling back to every normalized-name-substring match. Useful to surface (rather than silently collapse) names shared across factions.
All records belonging to a faction id (empty if the type has no faction).
A collection of one entity type, exposing id/name/faction lookups.
Iterable:
for (const unit of units) { … }.