Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PredicateType

Represents a type predicate.

function isString(anything: any): anything is string {}
function assert(condition: boolean): asserts condition {}

Hierarchy

  • Type
    • PredicateType

Index

Constructors

constructor

  • new PredicateType(name: string, asserts: boolean, targetType?: Type): PredicateType

Properties

asserts

asserts: boolean

True if the type is of the form asserts val is string, false if the type is of the form val is string

name

name: string

The identifier name which is tested by the predicate.

Optional targetType

targetType: Type

The type that the identifier is tested to be. May be undefined if the type is of the form asserts val. Will be defined if the type is of the form asserts val is string or val is string.

type

type: "predicate" = "predicate"

The type name identifier.

Methods

clone

equals

  • equals(type: Type): boolean
  • Test whether this type equals the given type.

    Parameters

    • type: Type

      The type that should be checked for equality.

    Returns boolean

    TRUE if the given type equals this type, FALSE otherwise.

toObject

  • toObject(): any

toString

  • toString(): string

Static isTypeListEqual

  • isTypeListEqual(a: Type[], b: Type[]): boolean

Static isTypeListSimilar

  • isTypeListSimilar(a: Type[], b: Type[]): boolean

Generated using TypeDoc