UNPKG

1.28 kBTypeScriptView Raw
1import { Entity, EntityCrudRepository, Getter, HasManyDefinition, InclusionResolver } from '../..';
2import { HasManyThroughRepository } from './has-many-through.repository';
3/**
4 * a factory to generate hasManyThrough repository class.
5 *
6 * Warning: The hasManyThrough interface is experimental and is subject to change.
7 * If backwards-incompatible changes are made, a new major version may not be
8 * released.
9 */
10export declare type HasManyThroughRepositoryFactory<TargetEntity extends Entity, TargetID, ThroughEntity extends Entity, SourceID> = {
11 (fkValue: SourceID): HasManyThroughRepository<TargetEntity, TargetID, ThroughEntity>;
12 /**
13 * Use `resolver` property to obtain an InclusionResolver for this relation.
14 */
15 inclusionResolver: InclusionResolver<Entity, TargetEntity>;
16};
17export declare function createHasManyThroughRepositoryFactory<Target extends Entity, TargetID, Through extends Entity, ThroughID, SourceID>(relationMetadata: HasManyDefinition, targetRepositoryGetter: Getter<EntityCrudRepository<Target, TargetID>> | {
18 [repoType: string]: Getter<EntityCrudRepository<Target, TargetID>>;
19}, throughRepositoryGetter: Getter<EntityCrudRepository<Through, ThroughID>>): HasManyThroughRepositoryFactory<Target, TargetID, Through, SourceID>;