TypeScript ネスト的な型
type MyObj<T> = {
[P in keyof T]: Record<P, MyObj<T>> | undefined
}
type Hoge = MyObj<{hoge: string}>
const a: Hoge = {
hoge: {
hoge: {
hoge: {
hoge: {
hoge: undefined
}
}
}
}
}
最近のコメント