In the following function type, I use Omit<TComponent, 'onClose'> multiple types. Is there a way I can "assign" that a type somewhere (inside the generic maybe?) so that I can have a reusable type rather than declare that twice?
export type WindowOpenFunction = <TComponent extends Closeable>(
window: ComponentType<TComponent>,
...args: keyof Omit<TComponent, 'onClose'> extends never ? [] : [Omit<TComponent, 'onClose'>]
) => TComponent extends Closeable<infer R> ? Promise<R> : Promise<undefined>