@primer/react
Version:
An implementation of GitHub's Primer Design System using React
20 lines • 585 B
TypeScript
/**
* Given two object types A and B, return a type with all the properties of A that aren't also
* properties of B, and all the properties of B.
*
* Useful when we have a component that spreads a "rest" of its props on a subcomponent:
*
* ```ts
* interface OwnProps {
* foo: string
* }
*
* type MyComponentProps = Merge<SubcomponentProps, OwnProps>
* const MyComponent = ({foo, ...rest}: MyComponentProps) => {
* // ...
* return <SubComponent {...rest} />
* }
* ```
*/
export type Merge<A = {}, B = {}> = Omit<A, keyof B> & B;
//# sourceMappingURL=Merge.d.ts.map