UNPKG

933 BTypeScriptView Raw
1import { HasManyDefinition } from '../relation.types';
2/**
3 * Relation definition with optional metadata (e.g. `keyTo`) filled in.
4 * @internal
5 */
6export type HasManyResolvedDefinition = HasManyDefinition & {
7 keyFrom: string;
8 keyTo: string;
9};
10/**
11 * Resolves given hasMany metadata if target is specified to be a resolver.
12 * Mainly used to infer what the `keyTo` property should be from the target's
13 * belongsTo metadata
14 * @param relationMeta - hasMany metadata to resolve
15 * @internal
16 */
17export declare function resolveHasManyMetadata(relationMeta: HasManyDefinition): HasManyResolvedDefinition;
18/**
19 * A helper to check relation type and the existence of the source/target models
20 * and set up keyFrom
21 * for HasMany(Through) relations
22 * @param relationMeta
23 *
24 * @returns relationMeta that has set up keyFrom
25 */
26export declare function resolveHasManyMetaHelper(relationMeta: HasManyDefinition): HasManyDefinition;