UNPKG

1.86 kBTypeScriptView Raw
1import { RelationType } from "../metadata/types/RelationTypes";
2import { RelationOptions } from "../decorator/options/RelationOptions";
3import { PropertyTypeFactory } from "../metadata/types/PropertyTypeInFunction";
4import { RelationTypeInFunction } from "../metadata/types/RelationTypeInFunction";
5/**
6 * Arguments for RelationMetadata class.
7 */
8export interface RelationMetadataArgs {
9 /**
10 * Class to which this relation is applied.
11 */
12 readonly target: Function | string;
13 /**
14 * In the case if this relation is without a target, targetId must be specified.
15 * This is used for entity schemas without classes.
16 */
17 /**
18 * Class's property name to which this relation is applied.
19 */
20 readonly propertyName: string;
21 /**
22 * Indicates if this relation will be lazily loaded.
23 */
24 readonly isLazy: boolean;
25 /**
26 * Original (reflected) class's property type.
27 *
28 * todo: this can be empty for relations from entity schemas.
29 */
30 /**
31 * Type of relation. Can be one of the value of the RelationTypes class.
32 */
33 readonly relationType: RelationType;
34 /**
35 * Type of the relation. This type is in function because of language specifics and problems with recursive
36 * referenced classes.
37 */
38 readonly type: RelationTypeInFunction;
39 /**
40 * Inverse side of the relation.
41 */
42 readonly inverseSideProperty?: PropertyTypeFactory<any>;
43 /**
44 * Additional relation options.
45 */
46 readonly options: RelationOptions;
47 /**
48 * Indicates if this is a parent (can be only many-to-one relation) relation in the tree tables.
49 */
50 readonly isTreeParent?: boolean;
51 /**
52 * Indicates if this is a children (can be only one-to-many relation) relation in the tree tables.
53 */
54 readonly isTreeChildren?: boolean;
55}