Represents a literal type.

type A = "A"
type B = 1

Hierarchy

Constructors

  • new LiteralType(value: null | string | number | bigint | boolean): LiteralType

Properties

type: "literal" = "literal"

The type name identifier.

value: null | string | number | bigint | boolean

Methods

  • getTypeString(): string
  • Return a string representation of this type.

    Returns string

  • needsParenthesis(): boolean
  • toString(): string
  • Return a string representation of this type.

    Returns string

  • Visit this type, returning the value returned by the visitor.

    Type Parameters

    • T

    Parameters

    Returns T

  • Type Parameters

    • T

    Parameters

    Returns undefined | T

Generated using TypeDoc