Skip to content

getEnumKey<T>

Get the key of an enum value.

Import:

import { getEnumKey } from 'obsidian-dev-utils/enum';

Signature:

function getEnumKey(enumType: T, value: T[keyof T]): keyof T

Parameters:

ParameterTypeDescription
enumTypeTThe enum type.
valueT[keyof T]The value to get the key of.

Returns: keyof T — The key of the enum value.