1 | import { Entity } from '../../model';
|
2 | import { EntityCrudRepository } from '../../repositories/repository';
|
3 | import { BelongsToDefinition, Getter, InclusionResolver } from '../relation.types';
|
4 | export interface BelongsToAccessor<Target extends Entity, SourceId> {
|
5 | |
6 |
|
7 |
|
8 | (sourceId: SourceId, polymorphicTypes?: string | string[]): Promise<Target>;
|
9 | |
10 |
|
11 |
|
12 | inclusionResolver: InclusionResolver<Entity, Target>;
|
13 | }
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export declare function createBelongsToAccessor<Target extends Entity, TargetId, Source extends Entity, SourceId>(belongsToMetadata: BelongsToDefinition, targetRepositoryGetter: Getter<EntityCrudRepository<Target, TargetId>> | {
|
20 | [repoType: string]: Getter<EntityCrudRepository<Target, TargetId>>;
|
21 | }, sourceRepository: EntityCrudRepository<Source, SourceId>): BelongsToAccessor<Target, SourceId>;
|