Untitled
Anonymous
plain_text
08/07/2023 11:56 AM
352 B
15
Indexable
type Obj = Record<string, string | number[]>
type ToIds<T extends Obj> = {
[K in keyof T]: T[K] extends string ? string : number;
}
const obj = {
advisor: "Alert",
cancel: "Button",
option: [1,2],
}
type Test = ToIds<typeof obj>Editor is loading...