Ver Fonte

added PickRequired type helper

Alexander Rose há 5 anos atrás
pai
commit
3942f1bc33
1 ficheiros alterados com 1 adições e 0 exclusões
  1. 1 0
      src/mol-util/type-helpers.ts

+ 1 - 0
src/mol-util/type-helpers.ts

@@ -7,6 +7,7 @@
 
 export type Mutable<T> = { -readonly [P in keyof T]: T[P] }
 export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
+export type PickRequired<T, K extends keyof T> = T & Required<Pick<T, K>>
 
 export type TypedIntArray = Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array
 export type TypedFloatArray = Float32Array | Float64Array