UNPKG

@halospv3/hce.shared-config

Version:

Automate commit message quality, changelogs, and CI/CD releases. Its `main` entry point is a Semantic Release config. Functions and classes are exposed for customization. An ESLint config, a Commitlint config, and addl. resources for .NET projects are als

18 lines 1.72 kB
import { BaseClassProto, ClassLike, ConstructorConstraint, ProtoChainOfClass, ProtoChainOfClassInstance, SuperClassLike, WithProto } from "./inheritance.mjs"; //#region src/utils/reflection/getPrototypeChainOf.d.ts type PrototypeChain<Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>, ClassesOrInstances extends "classes" | "classInstances"> = [ClassesOrInstances] extends ["classInstances"] ? ProtoChainOfClassInstance<Class> : [ClassesOrInstances] extends ["classes"] ? ProtoChainOfClass<Class> : never; /** * Iterate through the class and its base/super classes until an anonymous function is reached. This is the default superclass all classes extend. * @template Class Any {@link ClassLike} type. * @template ClassesOrInstances 'classes' or 'classInstances' * @param classDefinition Any class type satisfying {@link Class}. This class (or its instance type) is included in the return value. * @param [returnType='classes'] Determines return type. If 'classInstances', the return type is an array of the classes' `.prototype`. Else, the classes themselves are returned. * @since 3.0.0 * @returns * `returnType extends 'classInstances' ? ClassLike<T>[] : ClassLike<T>[].map(c => c.prototype)` * Excludes default superclasses e.g. anonymous functions, native code. */ declare function getPrototypesChainOf<Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>, ClassesOrInstances extends "classes" | "classInstances">(classDefinition: Class, returnType: ClassesOrInstances): PrototypeChain<Class, ClassesOrInstances>; //#endregion export { getPrototypesChainOf }; //# sourceMappingURL=getPrototypeChainOf.d.mts.map