How to extract a new type alias from an object's value
const test = {
'a': ['music','bbq','shopping'],
'b': ['move','work']
};
如何从 test 对象中得到
type Types = 'music' | 'bbq' | 'shopping' | 'move' | 'work'
1
zy0829 2023-05-08 15:14:39 +08:00
type Types<T> = T[keyof T]
|