ts-fortress
    Preparing search index...

    Type Alias ConstraintsOf<T>

    ConstraintsOf: T extends WithConstraints<infer C> ? C : never

    The constraint values carried by a type, or never for a type that carries none.

    Type Parameters

    • T extends UnknownType
    import * as t from 'ts-fortress';

    const Age = t.number(0, { int: true, min: 0, max: 120 });

    type AgeConstraints = t.ConstraintsOf<typeof Age>;

    // { readonly int: true; readonly min: 0; readonly max: 120; ... }
    const ageConstraints: AgeConstraints = Age.constraints;

    assert.strictEqual(ageConstraints.max, 120);