devtypes - v2.0.0
    Preparing search index...

    Type Alias AssertString<T>

    AssertString: T

    Assert that a type resolves to a string.

    Type Parameters

    • T extends string

      Type that must be a string

    Produces a compiler error if the provided type is not a string.

    type A = AssertString< '42' >;  // ✓
    type B = AssertString< 42 >; // ✗ TS error