GeneratorContext Type
Record fields
| Record Field |
Description
|
|
THE ERASURE LEDGER (docs/GOALS.md Done(L1): every deliberate degradation
counted and classed). Keys are "
|
|
|
|
The top-level export's canonical anchor currently being rendered during the counting pre-pass, threaded so `prerender`'s union-member recording knows the referencing owner. A mutable cell (the surrounding record is otherwise immutable); `ValueNone` outside the counting pass and between exports.
|
|
|
|
Every REAL declared type's flattened path (interface/class/alias/enum, all modules), recorded by `markDeclaredTypePaths` before processExports. The dangling-self-namespace scrub's KEEP-list: a holder variable named like its own type (`env: Cloudflare.Env`) produces a ref that coincides with the export's anchor namespace yet targets a REAL type — never scrub those.
|
Full Usage:
ErasedRoots
Field type: string list
|
Top-level module names under erase-with-advisory policy (+ the internal chunk-stub module). A shared synthetic whose owners ALL live under these roots is itself erased content: its home mints under the first erased root, which the path substitution immediately rewrites to the Erased.* alias — definitions drop with the erased modules, references collapse.
|
|
Per-export RenderScopeStore, MEMOIZED across export passes: nested children register into this store only when their refs mint FRESH — a re-anchor pass (the scrub-armed second export pass) that rebuilt stores from scratch would cache-hit those renders and under-register, silently shrinking the child set. Reusing the pass-1 store lets pass 2 re-anchor the FULL child set with the scrubs armed.
|
|
LAMBDA-LIFTED hoisted-home typars (stage 3b). A hoisted object literal grafted under its owning alias (`caseLiteralRef`) whose members reference the alias's typars must ABSTRACT over them: the emitted nested def declares these typars (the anchor stage overrides the def's TypeParameters from this table, growing the orphan-scrub inScope so member typar references SURVIVE), and the alias's abbreviation body APPLIES them (the caseRef is a Prefix over the case path). Keyed by the literal's ResolvedType — the same identity the TypeStore graft uses. Only single-owner (non-SharedLiterals) literals are lifted; multi-owner homes are the stage-4 extension.
|
|
|
|
Flattened dotted paths of every NAMESPACE emitted as a module (populated by a pre-pass before processExports). A TS name declared as BOTH an interface and a namespace collides in F#: the module wins the name slot and the interface def is dropped. A type-REF to the (dropped) interface then dangles (FS0039). Such a ref has no faithful F# target — a namespace used as a value type is untypeable — so it erases to `obj`, ledgered. Consulted in `prerender`'s Interface arm.
|
|
|
|
|
|
Canonical owner-independent home for a hoisted object-LITERAL that is reached through MORE THAN ONE distinct owner context (a shared `ResolvedType.TypeLiteral` the decoder's structural compression interned into one node). Populated by a counting pre-pass (`markSharedLiterals`). When present for a literal's ResolvedType, `prerender` roots that literal at this absolute `TypePath` (under `SharedLiterals`) instead of a per-owner transient — so every reference resolves to the same re-anchor-invariant ConcretePath and the single def is emitted once. This mirrors the proven `LiteralUnions` canonical-home mechanism, gated to genuinely-shared literals so single-owner depth-2 literals keep nesting under their owner.
|
Full Usage:
SharedLiteralRefOwners
Field type: Dictionary<ResolvedType, HashSet<AnchorPath>> voption
|
Phase-1 collector for UNION-WRAPPED shared object-literals — the def-VISIT gate
(`SharedLiteralVisits`) cannot see these. A multi-member object-literal reached only
inside a union molecule (`U2
|
|
Phase-1 collector for the shared-literal counting pre-pass. When `ValueSome`, the anchoring walk records, per hoisted object-literal ResolvedType, the set of distinct anchored def-home paths it is visited under. A literal with >1 distinct home is shared across owners and is assigned a canonical `SharedLiteralHomes` entry. `ValueNone` in the real (phase-2) pass so the counting is a no-op there.
|
|
|
|
HOME-CHILD SCRUB STATE (armed by `emitCanonicalPreludeScopes`' post-drive second round, empty = inactive). `SyntheticHomePaths` = the flattened paths of every canonical shared-literal home; `SyntheticHomeChildDefs` = every MATERIALIZED def path (scope roots + child anchors) once the fixpoint drive completes. A path atom under a home with no matching materialized def can never resolve (the multi-member shared-rt class: per-site leaf stamping vs the one-slot rt-keyed store) — the scrub degrades it to `obj`, ledgered.
|
Full Usage:
SyntheticPlacementOrder
Field type: string list
|
The recipe's publish-ordered top-level module names (unit boundaries), set in
emission. When non-empty, shared synthetic homes mint under
`
|
|
The surface's own top-level globals (excludes lib.es internals). Used to keep a `typescript`-sourced top-level export from being dropped by the source-ignore gate, so its definition is emitted at the global root where references resolve.
|
|
Declared type-parameter arity for each `TypeAliasRemap` key (the alias body / export-key instances). A generic mapped/utility alias (`Without`, `Params `) is referenced in
member/union/heritage positions whose IR has ALREADY been resolved to the alias's bare
structural BODY — the encoder dropped the application's `TypeArguments`. The remap then
renders the body as the bare alias NAME, but the alias is emitted as `type Without<'U,'T>`,
so the bare name is FS0033 ("expects N type argument(s) but is given 0"). The args are
unrecoverable at these sites (gone from the IR), so the remap pads the name to this declared
arity with `obj` placeholders (`Without
|
|
|
|
The declared typars (decoder-level, with their TS Constraint/Default lazies) of each remap-registered alias, keyed like `TypeAliasArity`. Consumed by the arity padders: a CONSTRAINED typar position cannot accept the `obj` placeholder (`'T :> ZodTypeAny` given `obj` is FS0001), so pads synthesize the typar's TS DEFAULT where present — which TS guarantees exists for any elidable parameter. Populated write-once in prerenderTypeAliases phase 2 (real pass only).
|