$ npm install @alloc/types
Common types for TypeScript
import { Lookup } from '@alloc/types'
import { ElementType } from '@alloc/types/react'
Solve<T> for solving generic types
Remap<T> to simplify & out of an object type
Pick<T, K> the same as built-in Pick but wrapped with Solve
Overwrite<T, U> for merging two object types (where U takes precedence)
MergeUnknown<T, U> for merging two object types (where T takes precedence)
MergeDefaults<T, U> for making T properties optional if they exist in U
ElementType<P> as a workaround for #34237
ComponentPropsWithRef<T> which uses ElementType
© 2010 - cnpmjs.org x YWFE | Home | YWFE