/** * @internal */ type AbstractConstructorType = abstract new (...args: any[]) => X; type ConcreteConstructorType = new (...value: any[]) => X; type ConstructorType = ConcreteConstructorType | AbstractConstructorType; /** * @internal */ type MethodPropertyDescriptor = PropertyDescriptor & { value: (...args: any[]) => any; get: never; }; /** * @internal */ type Prototype = Record & { constructor: ConstructorType; }; interface AbstractToken { readonly template?: T | ConstructorType; } /** * Disables errors when calling ${@link abstract} method. * @param receipe the function to be executed without throwing an error in case ${@link abstract} method is called. * @returns */ declare const _defuseAbstract: (receipe: () => unknown) => unknown; /** * Annotating abstract methods is not allowed in TypeScript. * Instead, we have to define concrete, empty methods, awaiting for an annotation to actually define its behaviour. * However, typescript will throw a compilation error if that method declares a return value but the body is empty. * The abstract function is a placeholder that stands for a return value. * It will throw if called as is, but it is intended to be bypassed by the action of an annotation. * * @param T the type of the value to be replaced. */ declare function abstract(): T; declare function abstract(template: [ConstructorType]): T[]; declare function abstract(template: ConstructorType): T; declare function abstract(template: T): T; declare const isAbstractToken: (val: any) => boolean; declare function setDebug(debug: boolean): void; declare function isDebug(): boolean; declare function assert(condition: boolean, errorProvider?: () => Error): void; declare function assert(condition: () => boolean, errorProvider?: () => Error): void; declare function assert(condition: boolean, msg?: string): void; declare function assert(condition: true, msg?: string): void; declare function assert(condition: false, msg?: string): never; /** * @internal */ declare const _copyPropsAndMeta: (target: T, source: T, propertyKeys?: (string | symbol)[]) => void; declare function getMetadataKeys(target: object, propertyKey?: string | symbol): string[]; declare function defineMetadata(key: string, value: any, target: object, propertyKey?: string | symbol): void; declare function getMetadata(key: string | symbol, target: object, valueGenerator?: () => T, save?: boolean): T; declare function getMetadata(key: string | symbol, target: object, propertyKey: string | symbol, valueGenerator?: () => T, save?: boolean): T; declare function getPrototype(target: Record | Function | undefined): Prototype; declare function isAnnotation(obj: unknown): boolean; declare function isFunction(value: unknown): value is (...args: unknown[]) => unknown; declare function isObject(value: unknown): value is object; declare function isNumber(value: unknown): value is number; declare function isUndefined(value: unknown): value is undefined; declare function isEmpty(value: unknown[]): boolean; declare function isPromise(obj: any): obj is Promise; declare function isClassInstance(obj: any): boolean; export { type AbstractConstructorType, type AbstractToken, type ConcreteConstructorType, type ConstructorType, type MethodPropertyDescriptor, type Prototype, _copyPropsAndMeta, _defuseAbstract, abstract, assert, defineMetadata, getMetadata, getMetadataKeys, getPrototype, isAbstractToken, isAnnotation, isClassInstance, isDebug, isEmpty, isFunction, isNumber, isObject, isPromise, isUndefined, setDebug };