/** * A class decorator function. */ export type ClassDecoratorFunction any = new (...args: any[]) => any> = (target: TFunction, context: ClassDecoratorContext) => void | TFunction; /** * A method decorator function. */ export type MethodDecoratorFunction = (target: TFunction, context: ClassMethodDecoratorContext) => void | TFunction; type ParameterPrefixTuples = TParameters extends readonly [infer Head, ...infer Tail] ? TPrefix | ParameterPrefixTuples : TPrefix; /** * A function type that can accept any prefix of the parameters of `TFunction` * while preserving its return type. */ export type CompatibleMethod any> = ParameterPrefixTuples> extends infer TPrefixes ? TPrefixes extends readonly unknown[] ? (...args: TPrefixes) => ReturnType : never : never; export type CompatibleMethodDecorator any> = >(target: TCompatible, context: ClassMethodDecoratorContext) => void | TCompatible; export {};