export type Omit < T , K > = Pick < T , Exclude < keyof T , K > > ; export const tuple = < T extends string [ ] > ( ... args ) => args ; export const tupleNum = < T extends number [ ] > ( ... args ) => args ; export const withDefaultProps = < P extends object , DP extends Partial < P > = Partial < P > > ( defaultProps , Cmp ) => { type RequiredProps = Omit < P , keyof DP > ; type Props = Partial < DP > & Required < RequiredProps > ; Cmp . defaultProps = defaultProps ; return ( Cmp as React . ComponentType < any > ) as React . ComponentType < Props > ; } ; export type Weaken < T , K extends keyof T > = { [ P in keyof T ] : P extends K ? any : T [ P ] ; } ;