In TypeScript, you can combine two interface types like this
interface Foo {
var1: string
}
interface Bar {
var2: string
}
type Combined = Foo & Ba
In TypeScript 2.8 you can now do the following:
interface Foo {
attribute1: string;
optional2?: string;
excludePlease: string;
}
// Typescript 3.5+ defines Omit for you.
// In earlier Typescript versions define Omit:
// type Omit = Pick>
// Use Omit to exclude one or more fields (use "excludePlease"|"field2"|"field3" etc to exclude multiple)
type Bar = Omit
const b: Bar = {
attribute1: ''
};
So in relation to your question the following might be what you want:
export default function valueHOC (
Comp: React.ComponentClass
| React.StatelessComponent
): React.ComponentClass> {
return class WrappedComponent extends React.Component, State> {
render () {
return (
)
}
}