Considering following TS definition:
type GenericPropsWithChildren<T> = T & { children?: ReactNode };
Nothing wrong with type
but I wonder if there is an interface
equivalent? Obviously it is possible to pass generics down into interfaces though that is not what I am after, e. g.:
interface GenericPropsWithChildren<T> {
children?: ReactNode;
myProps: T; // not desired
}
The examples here are in a context of React code but the underlying issue is fundamental TS.