mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-15 01:01:20 +10:00
feat(type utils): add enum dictionary type
This commit is contained in:
4
server/internal/utils/types.d.ts
vendored
4
server/internal/utils/types.d.ts
vendored
@ -5,3 +5,7 @@ export type FilterConditionally<Source, Condition> = Pick<
|
|||||||
export type KeyOfType<T, V> = keyof {
|
export type KeyOfType<T, V> = keyof {
|
||||||
[P in keyof T as T[P] extends V ? P : never]: any;
|
[P in keyof T as T[P] extends V ? P : never]: any;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type EnumDictionary<T extends string | symbol | number, U> = {
|
||||||
|
[K in T]: U;
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user