UNPKG

obsidian-dev-utils

Version:

This is the collection of useful functions that you can use for your Obsidian plugin development

22 lines (21 loc) 628 B
/** * @packageDocumentation * * Contains utility functions for enums. */ /** * Get the key of an enum value. * * @param enumType - The enum type. * @param value - The value to get the key of. * @returns The key of the enum value. */ export declare function getEnumKey<T extends Record<string, string>>(enumType: T, value: T[keyof T]): keyof T; /** * Get the value of an enum key. * * @param enumType - The enum type. * @param key - The key to get the value of. * @returns The value of the enum key. */ export declare function getEnumValue<T extends Record<string, string>>(enumType: T, key: string): T[keyof T];