Logo Xantham

ArenaInterner Module

Functions and values

Function or value Description

isShareableAliasBody _arg1

Full Usage: isShareableAliasBody _arg1

Parameters:
Returns: bool
_arg1 : ResolvedType
Returns: bool

libEsAliasTarget value

Full Usage: libEsAliasTarget value

Parameters:
Returns: string option

A STDLIB ALIAS whose name has a Fable substitution (`PropertyKey` -> obj, ...) remaps to the SUBSTITUTED intrinsic, not its nominal path: the name-keyed LibEs prelude interceptor sees only Interface/Class/Enum nodes, so an alias's nominal remap would emit a bare stdlib name with no definition anywhere (the CodeMode PropertyKey FS0039 class). Extracted from the interner walk for isolation tests.

value : TypeAlias
Returns: string option

prerenderFromGraph ctx interner

Full Usage: prerenderFromGraph ctx interner

Parameters:

Performs prerendering of all types in the graph - the series of operations are performed in topological order, and provides guarantees of passing in deep transient filled type graphs such as with solid-js. The costs may outweigh the benefits in this scenario. Performance costs are significant.

  • Type aliases from the export map in the ArenaInterner are used to seed the type reference map - TypeAliases are encapsulations of the contained type, so we must register the encapsulation before we encounter the types to ensure that we do not render the reference generated from the underlying type.
  • The graph evaluation is forced from the lazy function in the ArenaInterner.
  • The graph is traversed in topological order by first yielding the cyclical keys of a graph, before yielding keys in the order of the number dependencies they have such that a type with no dependencies is registered first.

ctx : GeneratorContext
interner : ArenaInterner

prerenderTypeAliases ctx arena

Full Usage: prerenderTypeAliases ctx arena

Parameters:

True when a resolved type is memoised by the interner to a single shared instance (primitives, literals, globalThis). Such a type must NOT be used as a `TypeAliasRemap` key: the remap substitutes the alias name wherever that resolved type occurs, so aliasing a shared instance (e.g. `type D1SessionBookmark = string`, `type Mode = "primary-only"`) would make *every* occurrence of that primitive/literal render as the alias name across the entire surface. Only nominal/structural alias bodies are safe to remap.

ctx : GeneratorContext
arena : ArenaInterner

recordAliasArity ctx exportKeyType value

Full Usage: recordAliasArity ctx exportKeyType value

Parameters:
 Phase-2's PER-ALIAS emitted-arity recording (see prerenderTypeAliases), extracted
 from the interner walk for isolation tests. Rules:
  - GENERIC alias with a non-shareable body: record the EMITTED arity (declared
    count if `aliasKeepsTypars`, else an explicit 0) against the body instance and
    the (non-shareable) export-key instance; typars alongside when arity > 0 so
    the padders synthesize per-slot defaults. CONSTRAINED typars do NOT gate
    recording (2026-07-05): the historical exclusion existed because an `obj` pad
    violated a nominal constraint (FS0001), obsolete since the typar-constraint
    advisory-drop policy — leaving them unrecorded put refs on the
    `typeArguments.Length` fallback (the Mcp BaseToolCallback given-2-of-3 class).
  - NON-GENERIC alias: record an explicit 0 keyed ONLY by the export-key rt —
    unique per export, so no shared-BODY write-once conflicts — letting the
    aligners TRUNCATE spurious IR args (`RequestId = ProgressToken`).
  - IDENTITY alias: never recorded (padding `Identity` collides with real
    application args).
ctx : GeneratorContext
exportKeyType : ResolvedType
value : TypeAlias

Type something to start searching.