類型
要避免遞迴的類型
type Foo = { geo: GeoPoint, label: { text: string; size: number } };
type A = Partial<Foo>
// type A = { geo?: GeoPoint, label?: { text: string; size: number } }
type B = RecursivePartial<Foo>
// type B = { geo?: {x?: number, y?: number, z?: number, Add?.....}, label?: { text?: string; size?: number } }
type C = RecursivePartial<Foo, GeoPoint>
// type C = { geo?: GeoPoint, label?: { text?: string; size?: number } }
Generated using TypeDoc
TypeScript 類型,遞迴版的
Partial<T>
, 如果成員的類型是TExclude
則不遞迴