import { Class } from './common-types'; /** * A type resolver is a function that returns a class representing the type, * typically a Model or Entity (e.g. Product). * * We use type resolvers to break require() loops when defining relations. * The target model (class) is provided via a provider, thus deferring * the actual reference to the class itself until later, when both sides * of the relation are created as JavaScript classes. * * @typeParam Type - The type we are resolving, for example `Entity` or `Product`. * This parameter is required. * * @typeParam StaticMembers - The static properties available on the * type class. For example, all models have static `modelName` property. * When `StaticMembers` are not provided, we default to static properties of * a `Function` - `name`, `length`, `apply`, `call`, etc. * Please note the value returned by the resolver is described as having * arbitrary additional static properties (see how Class is defined). */ export type TypeResolver = () => Class & StaticMembers; /** * A function that checks whether a function is a TypeResolver or not. * @param fn - The value to check. */ export declare function isTypeResolver(fn: any): fn is TypeResolver; /** * A boxed type for `null` */ export declare function Null(): null; /** * Check if the provided function is a built-in type provided by JavaScript * and/or Node.js. E.g. `Number`, `Array`, `Buffer`, etc. */ export declare function isBuiltinType(fn: Function): boolean; export type NonFunction = T extends Function ? never : T; /** * Resolve a type value that may have been provided via TypeResolver. * @param fn - A type class or a type provider. * @returns The resolved type. */ export declare function resolveType(fn: TypeResolver | Class | Function): Class; export declare function resolveType(fn: NonFunction): T;