@bytebury/sauce - v1.4.0
    Preparing search index...

    Type Alias ValueOf<T>

    ValueOf: T extends UnknownList ? T[number] : T[keyof T]

    This is a utility type that allows you to get the values from an object or a list.

    Type Parameters

    • T
    const MyEnum = { foo: 'bar', another: 'baz' } as const;
    const MyList = ['apple', 'banana', 'orange'] as const;

    function example(param: ValueOf<typeof MyEnum>): void {
    // param would be: "bar" | "baz"
    }

    function example2(param: ValueOf<typeof MyList): void {
    // param would be: "apple" | "banana" | "orange"
    }