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

    類型別名 PartialExcept<T, K>

    PartialExcept: Partial<Omit<T, K>> & { [key in K]: T[key] }

    TypeScript 類型,Partial<T> 但是保留 K 包含的 Key 的成員。

    類型參數

    • T

      類型

    • K extends keyof T

      維持不變動的成員的 Key

    type Foo = { geo: GeoPoint; label: string; size: number; };
    type A = Partial<Foo>
    // type A = { geo?: GeoPoint; label?: string; size?: number; }
    type B = PartialExcept<Foo, "geo">
    // type B = { geo: GeoPoint; label?: string; size?: number; }
    type C = PartialExcept<Foo, "geo" | "size">
    // type C = { geo: GeoPoint; label?: string; size: number; }