Expand description
Top-level declarations of a module, indexed by symbol space.
PackageDeclaration is to a Submilli module what a .d.ts file is to a TypeScript
module — a description of what the module exposes to the outside world.
Codegen consumes its own module’s declaration as well as the declarations of
every imported module to translate symbolic names into Wasm import entries
and (post-MVP) to look up signatures for cross-module calls.
Structs§
- Class
Extends - A class’s resolved
extendsclause. Parent and type args are one fact: every chain walker that hops to the parent must zipargsagainst the parent’s generics, so they travel together. - Field
Sig - A class instance field. Unlike
PropertySig, a field may be mutable and carriesvisibility;readonlyfields are writeable only inside the declaring constructor. Optional fields widen reads toT | undefined. - Method
Sig - Namespace
Symbol - No runtime representation; member resolution is fully static.
Recursive derived operations require the containing declaration’s successful
PackageDeclaration::check_type_limitscheck since its last mutation. Namespaced types are also mirrored intoPackageDeclaration::typesunder their full dotted key. - Package
Declaration - Maps are
BTreeMapfor deterministic iteration order; codegen derives stable function-index assignments from it. - Param
- Property
Sig readonlymirrors the declared modifier and forbids writes through the interface (shallow — it does not affect assignability). Optional properties widen reads toT | undefined.- Runtime
Function - Type
Symbol - Value
Symbol
Enums§
- Accessor
Sig - One accessor function on a class property. Getter and setter are independent (TS 4.3+): a property may declare a getter, a setter, or both, and their types need not match. The setter carries its parameter (name + write type).
- Default
Value - Restricted to shapes materializable without re-evaluating arbitrary source.
Re-evaluated per call (matching JS/TS) — a fresh
TypedExpris spliced at each call site. - Dispatch
- Enum
Variant Value - Type
Kind - Value
Kind