@cowwoc/requirements - v4.0.12
    Preparing search index...

    Class Type

    Describes the type of a value.

    Index

    Properties

    category: TypeCategory
    name: null | string
    typeGuard?: (value: unknown) => boolean
    ANONYMOUS_FUNCTION: Type = ...

    An anonymous or arrow function.

    ARRAY: Type = ...
    BIGINT: Type = ...
    BOOLEAN: Type = ...
    NULL: Type = ...
    NUMBER: Type = ...
    STRING: Type = ...
    SYMBOL: Type = ...
    UNDEFINED: Type = ...

    Methods

    • Indicates if this type is equal to another type.

      Parameters

      • other: Type

        another type

      Returns boolean

      true if this type matches other

    • Returns the type of this type.

      Returns Type

      the type of this type

    • Returns boolean

      true if the type is an undefined, null, boolean, number, bigint, string or symbol value

    • Indicates whether this type is a subtype of another type. Note that types are considered subtypes of themselves.

      Parameters

      • parent: Type

        the parent type

      Returns boolean

      • `true` if `child` extends `parent`
      • `false` if `parent` or `child` are `undefined`, `null` or an object
      • `false` if `child` does not extend `parent`
    • Returns string

      the string representation of this object

    • Returns the type of an undefined, null, boolean, number, bigint, string or symbol value.

      Parameters

      • value: unknown

        a value

      Returns null | Type

      null if the value is not a primitive value

    • Returns the type of a named class.

      Parameters

      • name: null | string

        the name of the class, or null to represent any class.

      • OptionaltypeGuard: (value: unknown) => boolean

        (optional) for certain types, such as Typescript interfaces, runtime validation is not possible. In such a case, use a type guard to check if the value satisfies the type condition.

      Returns Type

      the type

    • Returns the type of a named function.

      Parameters

      • name: null | string

        (optional) the name of the function. name represents any named function.

      Returns Type

      the type