feat(type utils): add enum dictionary type
This commit is contained in:
parent
9c4b6f35bb
commit
f2e018277b
1 changed files with 4 additions and 0 deletions
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 {
|
||||
[P in keyof T as T[P] extends V ? P : never]: any;
|
||||
};
|
||||
|
||||
type EnumDictionary<T extends string | symbol | number, U> = {
|
||||
[K in T]: U;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue