• Define a shape part that requires an enum value.

    Type Parameters

    • const Parts extends readonly [Record<string, string | number>, undefined | string | number]

    Parameters

    Returns ShapeEnum<Parts>

    import {enumShape, defineShape} from 'object-shape-tester';

    enum MyEnum {
    A = 'a',
    B = 'b',
    }

    const myShape = defineShape({
    a: enumShape(MyEnum),
    });

    // `myShape.runtimeType` is `{a: MyEnum}`