UNPKG

1.06 kBTypeScriptView Raw
1import { Model, RelationDefinitionMap } from '../model';
2export declare const RELATIONS_KEY = "loopback:relations";
3/**
4 * Decorator for relations
5 * @param definition
6 * @returns A property decorator
7 */
8export declare function relation(definition?: Object): PropertyDecorator;
9/**
10 * Get metadata of all relations defined on a given model class.
11 *
12 * @param modelCtor - The model class (the constructor function).
13 * @returns A map of relation definitions
14 */
15export declare function getModelRelations(modelCtor: typeof Model): RelationDefinitionMap;
16/**
17 * Decorator for embedsOne
18 * @param definition
19 * @returns A property decorator
20 */
21export declare function embedsOne(definition?: Object): PropertyDecorator;
22/**
23 * Decorator for embedsMany
24 * @param definition
25 * @returns A property decorator
26 */
27export declare function embedsMany(definition?: Object): PropertyDecorator;
28/**
29 * Decorator for referencesOne
30 * @param definition
31 * @returns A property decorator
32 */
33export declare function referencesOne(definition?: Object): PropertyDecorator;