import type { IContainer, AsyncService } from './interfaces.js'; export type Abstract = Function & { prototype: T; }; export type Constructor = new (...args: any[]) => T; export type Class = Abstract | Constructor; /** * Factory functions should not be normal functions, * but arrow functions. Its is by js limitation * to detect if object is constructable */ export type Factory = (container: IContainer, ...args: any[]) => T; export type ClassArray = Class[]; /** * Extracts the instance type from a Class, distributing over unions. * e.g. InferClass | Class> = Foo | Bar */ export type InferClass = T extends Class ? U : never; /** * Extracts the element type from a TypedArray, distributing over unions. */ export type InferTypedArray = T extends { Type: Class | string; } ? U : never; /** * Distributive resolve result: wraps AsyncService members in Promise. * Distributes over union types automatically. */ export type ResolveResult = T extends AsyncService ? Promise : T; /** * Distributive resolve result for arrays. */ export type ResolveArrayResult = T extends AsyncService ? Promise : T[]; /** * Extracts instance type from Class or Factory, distributing over unions. */ export type InferClassOrFactory = T extends Class ? U : T extends Factory ? U : never; //# sourceMappingURL=types.d.ts.map