PilotGaea 3D O'view
    正在準備搜尋索引...

    類型別名 RecursivePartial<T, TExclude>

    RecursivePartial: {
        [P in keyof T]?: T[P] extends TExclude
            ? T[P]
            : RecursivePartial<T[P], TExclude>
    }

    TypeScript 類型,遞迴版的 Partial<T>, 如果成員的類型是 TExclude 則不遞迴

    類型參數

    • T

      類型

    • TExclude = never

      要避免遞迴的類型

    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 } }