diff --git a/src/util/extend.ts b/src/util/extend.ts index 5cab210..fb28207 100644 --- a/src/util/extend.ts +++ b/src/util/extend.ts @@ -22,6 +22,21 @@ export type Extend = ( : {} ) +export type Override = ( + T extends readonly [ + infer Super, + infer Self, + ...infer Rest extends readonly object[], + ] + ? Override> & Self, + ...Rest, + ]> + : T extends readonly [infer Self] + ? Self + : {} +) + /** * Merges an inheritance tree defined by an array of types without allowing overrides. * @template T - An array of types representing the inheritance tree.