import { SelectServiceBuilder } from './builders'; import { EntityService } from './index'; export declare const enum RelationType { BELONGS_TO = "BELONGS_TO", HAS_ONE = "HAS_ONE", HAS_MANY = "HAS_MANY", BELONGS_TO_MANY = "BELONGS_TO_MANY" } export interface RelationDefinition { type: RelationType; alias: string; } export interface BelongsToRelationDefinition extends RelationDefinition { foreignKey: string; } export interface BelongsToManyRelationDefinition extends RelationDefinition { pivotTable: string; pivotKey: string; } export interface InclusionInput { value: SelectServiceBuilder; as: string; } export interface WithRelations { belongsTo(this: WithRelations & T, service: T, foreignKey: string, alias?: string): WithRelations & T; hasMany(this: WithRelations & T, service: T, alias?: string): WithRelations & T; hasOne(this: WithRelations & T, service: T, alias?: string): WithRelations & T; belongsToMany(this: WithRelations & T, service: T, pivot: T | string, keyInPivot: string, alias?: string): WithRelations & T; getRelationWith(this: WithRelations & T, rel: T | string): RelationDefinition; } export declare type RelationArgument = InclusionInput | string | SelectServiceBuilder | EntityService;