Files and imports
Index
A place that holds definitions, and the one way to write and read them.
A code file is the root Index of its content: every generator can reach it. A definition whose value is an Index is a place too - a Kotlin class body, a TypeScript class - so Indexes nest, and a definition is found by the path of identifiers that leads to it.
Each language decides what its Indexes accept and how they render. The engine speaks only these two operations, and CodeFileBase already satisfies them.
Signature
import type { Index } from '@skmtc/core'Properties
Add a definition, applying this Index's rules: the entity types it accepts, the generator that owns it, and its duplicate rule. A rule break throws. Called by the engine's register.
Matching definitions, or undefined when nothing matches. With no query, every definition.