KC's Workspace
    Preparing search index...

    Represents a type predicate.

    function isString(x: unknown): x is string {}
    function assert(condition: boolean): asserts condition {}

    Hierarchy (View Summary)

    Index

    Constructors

    • Create a new PredicateType instance.

      Parameters

      • name: string

        The identifier name which is tested by the predicate.

      • 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

      • OptionaltargetType: SomeType

        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.

      Returns PredicateType

    Properties

    asserts: boolean
    name: string
    targetType?: SomeType
    type: "predicate"

    The type name identifier.

    Methods