Skip to content

ExportLayout

module ExportLayout
AssemblyXantham.Generator

Functions to allocate export paths and owners for declarations.

Functions and values

allOwners (model: ShapeModel) : ExportOwner list

Every owner referenced by a harvested export, across value exports and declared types.

allocate (runtimePackage: string<importSpecifier>) (declaredNames: string list) (owners: ExportOwner list) : Map<ExportOwner,string list>
containerName (declaredNames: string list) (owner: ExportOwner) (path: string list) : string
containers (model: ShapeModel) : Map<ExportOwner,string>

The container names of the owners whose harvested value exports become bound members.

containersFor (model: ShapeModel) (owners: ExportOwner list) : Map<ExportOwner,string>

Each owner's container name, Exports, Strict.Exports or Globals.Exports, for the owners given. Deterministic for one model and owner set, so shaping, literal retention and ordering share one map.

declPath (modulePaths: Map<ExportOwner,string list>) (model: ShapeModel) (export: HarvestedExport) : string list

The nested-module path an export's declared type, and every type synthesized beneath it, renders under. Empty for an entry-module or global-scope export.

depthOf (runtimePackage: string<importSpecifier>) (hasEntryOwner: bool) (owner: ExportOwner) : int

The nesting depth of an owner's preferred path: 0 for the entry module, and for globals the depth preferredPath gives them under the same hasEntryOwner.

hasEntryOwner (model: ShapeModel) : bool

Whether the run renders an entry module, which is what nests global-scope declarations under Globals and so gives them depth 1.

modulePaths (model: ShapeModel) : Map<ExportOwner,string list>

The nested-module path each owner's declared types render under, unique across owners. Empty for an entry-module or global-scope owner.

ownerOf (runtimePackage: string<importSpecifier>) (_arg1: ExportOrigin) : ExportOwner

Determine the export owner of a declaration from its export origin; delineates between ambient modules from the runtime package and ambient modules from other packages.

ownerSpecifier (owner: ExportOwner) : string

The ordinal tie-break key of an owner: its specifier, or "" for the entry module and globals.

preferredPath (runtimePackage: string<importSpecifier>) (hasEntryOwner: bool) (_arg1: ExportOwner) : string list