UNPKG

891 BTypeScriptView Raw
1import { Entity } from '../../model';
2import { EntityCrudRepository } from '../../repositories';
3import { Getter, HasOneDefinition, InclusionResolver } from '../relation.types';
4/**
5 * Creates InclusionResolver for HasOne relation.
6 * Notice that this function only generates the inclusionResolver.
7 * It doesn't register it for the source repository.
8 *
9 * Notice: scope field for inclusion is not supported yet.
10 *
11 * @param meta - resolved HasOneMetadata
12 * @param getTargetRepoDict - dictionary of target model type - target repository
13 * i.e where related instances for different types are
14 */
15export declare function createHasOneInclusionResolver<Target extends Entity, TargetID, TargetRelations extends object>(meta: HasOneDefinition, getTargetRepoDict: {
16 [repoType: string]: Getter<EntityCrudRepository<Target, TargetID, TargetRelations>>;
17}): InclusionResolver<Entity, Target>;