Function constants

  • Create a Constants object from an array of PropertyKeys, using each element both as key and value

    Returns

    A Constants object

    Type Parameters

    Parameters

    • tag: Tag

      The tag used to enable nominal typing

    • arr: Narrow<T>

      The input tuple containing the constants

    Returns ConstantsWrapper<{ [ I in keyof T & `${number}` as T[I]]: T[I] }, Tag>

  • Create a Constants object from a record containing arbitrary values

    Returns

    A Constants object

    Type Parameters

    Parameters

    • tag: Tag

      The tag used to enable nominal typing

    • obj: Narrow<T>

      The input record containing the keys and their values

    Returns ConstantsWrapper<T, Tag>

Generated using TypeDoc