UNPKG

1.33 kBTypeScriptView Raw
1import { DataTypeAbstract, ModelOptions } from 'sequelize';
2/**
3 * Sets model name from class by storing this
4 * information through reflect metadata
5 */
6export declare function setModelName(target: any, modelName: string): void;
7/**
8 * Returns model name from class by restoring this
9 * information from reflect metadata
10 */
11export declare function getModelName(target: any): string;
12/**
13 * Returns sequelize define options from class prototype
14 * by restoring this information from reflect metadata
15 */
16export declare function getOptions(target: any): ModelOptions | undefined;
17/**
18 * Sets seuqlize define options to class prototype
19 */
20export declare function setOptions(target: any, options: ModelOptions<any>): void;
21/**
22 * Adds options be assigning new options to old one
23 */
24export declare function addOptions(target: any, options: ModelOptions<any>): void;
25/**
26 * Maps design types to sequelize data types;
27 * @throws if design type cannot be automatically mapped to
28 * a sequelize data type
29 */
30export declare function getSequelizeTypeByDesignType(target: any, propertyName: string): DataTypeAbstract;
31/**
32 * Resolves all model getters of specified options object
33 * recursively.
34 * So that {model: () => Person} will be converted to
35 * {model: Person}
36 */
37export declare function resolveModelGetter(options: any): any;