import { CommonKeys } from "." // type ExtendReducer = ( // Pick> extends Pick> // ? Omit> & Self // : never // ) // interface ExtendReducerFn extends Fn { // return: ExtendReducer // } // export type ExtendFn = Tuples.Reduce // export type ExtendableFn = ComposeLeft<[ // ExtendFn, // Match<[ // Match.With, // Match.With, // ]> // ]> // TODO: use OverrideProperties from type-fest? export type Extend = ( T extends readonly [ infer Super, infer Self, ...infer Rest extends readonly object[], ] ? Pick> extends Pick> ? Extend> & Self, ...Rest, ]> : never : T extends readonly [infer Self] ? Self : {} ) export type Extendable = ( T extends readonly [ infer Super, infer Self, ...infer Rest extends readonly object[], ] ? Pick> extends Pick> ? Extendable> & Self, ...Rest, ]> : false : true ) export type NonExtendableKeys = ( T extends readonly [ infer Super extends object, infer Self extends object, ...infer Rest extends readonly object[], ] ? {[K in keyof Super & keyof Self]: Self[K] extends Super[K] ? never : K }[keyof Super & keyof Self] | NonExtendableKeys : void )