Xantham Namespace
Contents
Other namespace members
| Type/Module | Description |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Represents a TypeScript `class` with constructors, members, generics and heritage.
Reflects: `ClassDeclaration` and its computed `InterfaceType` for instance side.
Example (TS):
```ts
export class C |
|
|
Represents a TypeScript `class` with constructors, members, generics and heritage.
Reflects: `ClassDeclaration` and its computed `InterfaceType` for instance side.
Example (TS):
```ts
export class C |
|
|
|
|
|
|
|
|
Represents `extends` and `implements` relationships for classes. Reflects: `HeritageClause` with `extends`/`implements` on classes. |
|
|
Represents `extends` and `implements` relationships for classes. Reflects: `HeritageClause` with `extends`/`implements` on classes. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Represents a conditional type `T extends U ? X : Y`.
Reflects: `ConditionalType`.
Example (TS):
```ts
type IfNumber |
|
|
Represents a conditional type `T extends U ? X : Y`.
Reflects: `ConditionalType`.
Example (TS):
```ts
type IfNumber |
|
|
|
|
|
|
|
|
Represents a class constructor declaration. Reflects: `ConstructorDeclaration`. Example (TS): ```ts class C { constructor(readonly x: number) {} } ``` |
|
|
Represents a class constructor declaration. Reflects: `ConstructorDeclaration`. Example (TS): ```ts class C { constructor(readonly x: number) {} } ``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Represents a top-level (or exported) function declaration with its type and generics.
Reflects: `FunctionDeclaration` and its `Signature`.
Example (TS):
```ts
export function sum |
|
|
Represents a top-level (or exported) function declaration with its type and generics.
Reflects: `FunctionDeclaration` and its `Signature`.
Example (TS):
```ts
export function sum |
|
|
|
|
|
|
|
|
Represents a `get` accessor. Reflects: `GetAccessorDeclaration`. Example (TS): ```ts class C { get value(): number { return 0 } } ``` |
|
|
Represents a `get` accessor. Reflects: `GetAccessorDeclaration`. Example (TS): ```ts class C { get value(): number { return 0 } } ``` |
|
|
|
|
|
|
|
|
Represents the index type (key type) of an object for mapped/indexed operations. Reflects: `IndexType` used by the checker for `keyof` and index queries. |
|
|
Represents the index type (key type) of an object for mapped/indexed operations. Reflects: `IndexType` used by the checker for `keyof` and index queries. |
|
|
|
|
|
|
|
|
Represents an indexed access type, where a property type is selected by an index type.
Reflects: `IndexedAccessType`.
Example (TS):
```ts
type Foo |
|
|
Represents an indexed access type, where a property type is selected by an index type.
Reflects: `IndexedAccessType`.
Example (TS):
```ts
type Foo |
|
|
|
|
|
|
|
|
Represents an index signature (property access by key type) on an object type. Reflects: `IndexSignatureDeclaration` like `[key: string]: number` and readonly variants. Example (TS): ```ts interface MapLike { readonly [k: string]: number } ``` |
|
|
Represents an index signature (property access by key type) on an object type. Reflects: `IndexSignatureDeclaration` like `[key: string]: number` and readonly variants. Example (TS): ```ts interface MapLike { readonly [k: string]: number } ``` |
|
|
|
|
|
|
|
|
Represents a TypeScript `interface` type with its members and generics.
Reflects: `InterfaceDeclaration` and its computed `InterfaceType`.
Example (TS):
```ts
export interface IterableLike |
|
|
Represents a TypeScript `interface` type with its members and generics.
Reflects: `InterfaceDeclaration` and its computed `InterfaceType`.
Example (TS):
```ts
export interface IterableLike |
|
|
|
|
|
|
|
|
Represents `extends` relationships for interfaces. Reflects: `HeritageClause` with `extends` entries on interfaces. |
|
|
Represents `extends` relationships for interfaces. Reflects: `HeritageClause` with `extends` entries on interfaces. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Represents a |
|
|
Represents a |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Represents a property (class or interface) with additional modifiers. Reflects: `PropertyDeclaration` (class) and `PropertySignature` (interface), including `readonly`, `?` optional, `static`, and visibility modifiers. Example (TS): ```ts interface P { readonly name?: string } class C { private static count: number } ``` |
|
|
Represents a property (class or interface) with additional modifiers. Reflects: `PropertyDeclaration` (class) and `PropertySignature` (interface), including `readonly`, `?` optional, `static`, and visibility modifiers. Example (TS): ```ts interface P { readonly name?: string } class C { private static count: number } ``` |
|
|
|
|
|
|
|
|
Represents a `set` accessor. Reflects: `SetAccessorDeclaration`. Example (TS): ```ts class C { set value(v: number) {} } ``` |
|
|
Represents a `set` accessor. Reflects: `SetAccessorDeclaration`. Example (TS): ```ts class C { set value(v: number) {} } ``` |
|
|
|
|
|
|
|
|
Represents a substitution type: a type parameter substituted with a concrete type under its constraint context. Reflects: `SubstitutionType` in the TS type system. |
|
|
Represents a substitution type: a type parameter substituted with a concrete type under its constraint context. Reflects: `SubstitutionType` in the TS type system. |
|
|
|
|
|
|
|
|
Represents a template literal type with string segments and interpolated types. Reflects: `TemplateLiteralType` at the checker layer (TypeFlags.TemplateLiteral). Example (TS): `` `on${string}` `` where texts = ["on", ""] and types = [string] |
|
|
Represents a template literal type with string segments and interpolated types. Reflects: `TemplateLiteralType` at the checker layer (TypeFlags.TemplateLiteral). Example (TS): `` `on${string}` `` where texts = ["on", ""] and types = [string] |
|
|
|
|
|
|
|
|
Represents a tuple type and its structure. Reflects: `TupleType` and `TupleTypeNode` including readonly tuples. Example (TS): ```ts type T = readonly [x: number, y?: string, ...rest: boolean[]] ``` |
|
|
Represents a tuple type and its structure. Reflects: `TupleType` and `TupleTypeNode` including readonly tuples. Example (TS): ```ts type T = readonly [x: number, y?: string, ...rest: boolean[]] ``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Represents a tuple element's type and modifiers. Reflects: tuple element nodes including optional `?` and rest `...` (variadic) labels. |
|
|
Represents a tuple element's type and modifiers. Reflects: tuple element nodes including optional `?` and rest `...` (variadic) labels. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Represents a named alias for a type, possibly generic.
Reflects: `TypeAliasDeclaration`.
Example (TS):
```ts
export type ReadonlyList |
|
|
Represents a named alias for a type, possibly generic.
Reflects: `TypeAliasDeclaration`.
Example (TS):
```ts
export type ReadonlyList |
|
|
|
|
|
|
|
|
Represents an intersection type. Reflects: `IntersectionType` and `IntersectionTypeNode`. Example (TS): `type B = { x: number } & { y: number }` |
|
|
Represents an intersection type. Reflects: `IntersectionType` and `IntersectionTypeNode`. Example (TS): `type B = { x: number } & { y: number }` |
|
|
|
|
|
|
|
|
Represents a type literal `{ ... }` with inline members. Reflects: `TypeLiteralNode` and the corresponding anonymous object type. Example (TS): ```ts type Point = { x: number; y: number; (x: number): string } ``` |
|
|
Represents a type literal `{ ... }` with inline members. Reflects: `TypeLiteralNode` and the corresponding anonymous object type. Example (TS): ```ts type Point = { x: number; y: number; (x: number): string } ``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Represents a type predicate or assertion signature like `x is Foo` or `asserts x is Foo`. Reflects: `TypePredicateNode` and `TypePredicate`. Example (TS): ```ts function isNum(x: unknown): x is number { return typeof x === 'number' } function assertIsNum(x: unknown): asserts x is number { if (typeof x !== 'number') throw new Error() } ``` |
|
|
Represents a type predicate or assertion signature like `x is Foo` or `asserts x is Foo`. Reflects: `TypePredicateNode` and `TypePredicate`. Example (TS): ```ts function isNum(x: unknown): x is number { return typeof x === 'number' } function assertIsNum(x: unknown): asserts x is number { if (typeof x !== 'number') throw new Error() } ``` |
|
|
|
|
|
|
|
|
Represents a type query like `typeof Foo` or `typeof Foo.bar`. The type query is resolved to the type of the referenced entity. |
|
|
Represents a type query like `typeof Foo` or `typeof Foo.bar`. The type query is resolved to the type of the referenced entity. |
|
|
|
|
|
|
|
|
A member inside classes/interfaces/type literals; each case mirrors the
corresponding TypeScript declaration or signature node.
Represents a reference to a named type with optional type arguments.
Reflects: `TypeReference` (e.g., `Foo |
|
|
A member inside classes/interfaces/type literals; each case mirrors the
corresponding TypeScript declaration or signature node.
Represents a reference to a named type with optional type arguments.
Reflects: `TypeReference` (e.g., `Foo |
|
|
|
|
|
|
|
|
Represents a union type. Reflects: `UnionType` and `UnionTypeNode`. Example (TS): `type A = string | number` |
|
|
Represents a union type. Reflects: `UnionType` and `UnionTypeNode`. Example (TS): `type A = string | number` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A unique identifier for a type. |
|
|
A unique identifier for a type. |
|
|
|
|
|
|
|
|
Discriminated union of all high-level TypeScript type shapes the reader can produce. Each case mirrors a concrete TS type or declaration form (see individual types above). |
|
|
Discriminated union of all high-level TypeScript type shapes the reader can produce. Each case mirrors a concrete TS type or declaration form (see individual types above). |
Auxiliary
| Type | Description |
|
A tuple to be used by types which inline |
|
|
A tuple to be used by types which inline |
|
|
Indicates a type can be a member of a |
|
|
Indicates a type can be a member of a |
|
|
DU of TS comment tag types. |
|
|
DU of TS comment tag types. |
Container
| Type | Description |
|
Represents a non-empty collection of overloads of a type. |
|
|
Represents a non-empty collection of overloads of a type. |
Declaration Representation
| Type | Description |
|
Represents a call signature in a type literal or interface. Reflects: `CallSignatureDeclaration`.
interface FnLike { (x: number, y: number): number }
|
|
|
Represents a call signature in a type literal or interface. Reflects: `CallSignatureDeclaration`.
interface FnLike { (x: number, y: number): number }
|
|
|
Represents a construct signature (the type of `new` for a value). Reflects: `ConstructSignatureDeclaration`.
interface CtorLike { new (x: number): Date }
|
|
|
Represents a construct signature (the type of `new` for a value). Reflects: `ConstructSignatureDeclaration`.
interface CtorLike { new (x: number): Date }
|
|
|
Represents a method-like member (class or interface) or signature-like method. Reflects: `MethodDeclaration` (class), `MethodSignature` (interface), and function-like members including optional `?` and `static` modifiers.
interface I { foo(x: number): string }
class C { static bar(): void {} }
|
|
|
Represents a method-like member (class or interface) or signature-like method. Reflects: `MethodDeclaration` (class), `MethodSignature` (interface), and function-like members including optional `?` and `static` modifiers.
interface I { foo(x: number): string }
class C { static bar(): void {} }
|
|
|
Represents a function/method parameter. Reflects: `ParameterDeclaration` (including optional `?` and rest `...` syntax). |
|
|
Represents a function/method parameter. Reflects: `ParameterDeclaration` (including optional `?` and rest `...` syntax). |
|
|
Represents a top-level or module-scoped Reflects: |
|
|
Represents a top-level or module-scoped Reflects: |
Type Representation
| Type | Description |
|
Represents a single enum case in TypeScript. Reflects: |
|
|
Represents a single enum case in TypeScript. Reflects: |
|
|
Represents a TypeScript `enum` type. Reflects: `EnumDeclaration` and the resulting enum type. |
|
|
Represents a TypeScript `enum` type. Reflects: `EnumDeclaration` and the resulting enum type. |
|
|
DU of TS literal types. |
|
|
DU of TS literal types. |
|
|
Represents a generic type parameter with optional constraint and default. Reflects: `TypeParameterDeclaration` and `TypeParameter` (constraint `extends`, default value).
type Box<T extends object = {}> = { value: T }
|
|
|
Represents a generic type parameter with optional constraint and default. Reflects: `TypeParameterDeclaration` and `TypeParameter` (constraint `extends`, default value).
type Box<T extends object = {}> = { value: T }
|