Logo Xantham

Xantham.Decoder Namespace

Contents

Decoded Result

Type Description

CompressionResult

Intermediate result produced by the compression pass, holding the compressed type and export maps along with the protected top-level export set.

DecodedResult

Final shape returned by Decoder.read/Decoder.readWithSettings. Contains all decoded type, export, and module information from a Xantham JSON file in a form suitable for downstream generators.

ExportMap

Map from a source module path (string) to the set of TypeKeys declared as exports by that source. Used to look up all exports originating from a given .d.ts file or module.

ExportTypeMap

Map from a TypeKey to the TsExportDeclaration it identifies. Holds top-level exported declarations (variables, interfaces, classes, etc.) keyed by the same TypeKey address space as TypeMap.

LibSet

Set of TypeKeys that originate from the TypeScript standard (lib.es*.d.ts) library files. Used to differentiate runtime/builtin declarations from user-defined declarations.

TypeMap

Map from a TypeKey to the structural TsType it identifies. Produced by the decoder as the canonical store of all referenced types.

Names and Casing

Type/Module Description

Case

This provides unsafe means of removing/adding measures to a Name. Use with caution, as they are not associated with any transformations of the underlying strings.

CasedName

A Name tagged with one of the supported casing measures (Pascal, camel, module, or typar). Useful as an envelope when the casing flavour is decided dynamically rather than known statically.

Name (Module)

Name (Type)

Utility type for working with names or manipulating the names of types and members while preserving the original source.

Name<'u>

Provide static typing over the casing of a name

Other namespace members

Modules Description

ArenaInterner

Lazy resolved type graph for use in generators.

CodeKey

Discriminated unions tagging a TypeKey with the kind of construct it identifies. Used by consumers (e.g. generators) that need to dispatch on the structural kind of a type or export without re-walking the full TsType/TsExportDeclaration.

Decoder

Runtime

Type something to start searching.