UNPKG

@sequelize/core

Version:

Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server, Amazon Redshift, Snowflake’s Data Cloud, Db2, and IBM i. It features solid transaction support, relations, eager and lazy loading, read replication a

19 lines (18 loc) 1.42 kB
import type { AttributeOptions } from '../../model.js'; import type { OptionalParameterizedPropertyDecorator, RequiredParameterizedPropertyDecorator } from './decorator-utils.js'; import { DECORATOR_NO_DEFAULT } from './decorator-utils.js'; /** * Creates a decorator that registers Attribute Options. Parameters are mandatory. * * @param decoratorName The name of the decorator (must be equal to its export key) * @param callback The callback that will return the Attribute Options. */ export declare function createRequiredAttributeOptionsDecorator<T>(decoratorName: string, callback: (option: T, target: Object, propertyName: string | symbol, propertyDescriptor: PropertyDescriptor | undefined) => Partial<AttributeOptions>): RequiredParameterizedPropertyDecorator<T>; /** * Creates a decorator that registers Attribute Options. Parameters are optional. * * @param decoratorName The name of the decorator (must be equal to its export key) * @param defaultValue The default value, if no parameter was provided. * @param callback The callback that will return the Attribute Options. */ export declare function createOptionalAttributeOptionsDecorator<T>(decoratorName: string, defaultValue: T | typeof DECORATOR_NO_DEFAULT, callback: (option: T, target: Object, propertyName: string, propertyDescriptor: PropertyDescriptor | undefined) => Partial<AttributeOptions>): OptionalParameterizedPropertyDecorator<T>;