/** * @module common */ /** End Typedoc Module Declaration */ import { ModelStatic, ModelConstructor, AbstractModel } from '../model'; export declare type RelationType = 'hasOne' | 'hasMany' | 'belongsTo' | 'belongsToMany'; /** * This is a crude method to two-way register the type of binding for relations. This is to overcome * a limitation of Typescripts design-time decorators and node's module resolution. * @see https://github.com/Microsoft/TypeScript/issues/4521 */ export declare type ForeignRelationModelGetter = (thisStatic?: ModelStatic | any) => ModelStatic; export declare type ViaPropertyDefinition = (foreign: T) => any; export declare class Relation { model: ModelStatic; private foreignRelationModelGetter; viaProperty: ViaPropertyDefinition; databaseOptions: any; constructor(model: ModelStatic, foreignRelationModelGetter: ForeignRelationModelGetter, viaProperty: ViaPropertyDefinition, databaseOptions?: any); readonly foreign: ModelStatic; } /** * Initializes relation metadata property with empty values. Common function used by all relation * decorators to verify there is somewhere to assign their metadata. * @param target * @param type */ export declare function initializeRelationMap(target: ModelConstructor, type: RelationType): void; export * from './hasOne.decorator'; export * from './belongsTo.decorator';