UNPKG

rest-client-sdk

Version:
31 lines (30 loc) 1.17 kB
declare enum RelationTypes { ONE_TO_ONE = "ONE_TO_ONE", ONE_TO_MANY = "ONE_TO_MANY", MANY_TO_MANY = "MANY_TO_MANY", MANY_TO_ONE = "MANY_TO_ONE" } declare class Relation { static ONE_TO_ONE: RelationTypes; static ONE_TO_MANY: RelationTypes; static MANY_TO_ONE: RelationTypes; static MANY_TO_MANY: RelationTypes; type: RelationTypes; readonly targetMetadataKey: string; readonly serializedKey: string; readonly attributeName: string; /** * @param {RelationTypes} type the type of relation * @param {string} targetMetadataKey must match the first argument of `ClassMetadata` constructor of the target entity * @param {string} serializedKey the key returned from your API * @param {string|null} attributeName the name in your entity, default to the `serializedKey` attribute */ constructor(type: RelationTypes, targetMetadataKey: string, serializedKey: string, attributeName?: string | null); isOneToOne(): boolean; isOneToMany(): boolean; isManyToOne(): boolean; isManyToMany(): boolean; isRelationToMany(): boolean; isRelationToOne(): boolean; } export default Relation;