@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, Oracle, and IBM i. It features solid transaction support, relations, eager and lazy loading, read repli
11 lines (10 loc) • 1.45 kB
TypeScript
import type { MaybeForwardedModelStatic } from '../../associations/helpers.js';
import type { BelongsToManyOptions, BelongsToOptions, HasManyOptions, HasOneOptions } from '../../associations/index.js';
import type { AttributeNames, Model, ModelStatic } from '../../model.js';
import type { Sequelize } from '../../sequelize.js';
export type AssociationType = 'BelongsTo' | 'HasOne' | 'HasMany' | 'BelongsToMany';
export declare function HasOne<Target extends Model>(target: MaybeForwardedModelStatic<Target>, optionsOrForeignKey: Omit<HasOneOptions<string, AttributeNames<Target>>, 'as'> | AttributeNames<Target>): (source: Model, associationName: string | symbol) => void;
export declare function HasMany<Target extends Model>(target: MaybeForwardedModelStatic<Target>, optionsOrForeignKey: Omit<HasManyOptions<string, AttributeNames<Target>>, 'as'> | AttributeNames<Target>): (source: Model, associationName: string | symbol) => void;
export declare function BelongsTo<SourceKey extends string, Target extends Model>(target: MaybeForwardedModelStatic<Target>, optionsOrForeignKey: Omit<BelongsToOptions<SourceKey, AttributeNames<Target>>, 'as'> | SourceKey): (source: Model, associationName: string) => void;
export declare function BelongsToMany(target: MaybeForwardedModelStatic, options: Omit<BelongsToManyOptions, 'as'>): PropertyDecorator;
export declare function initDecoratedAssociations(source: ModelStatic, sequelize: Sequelize): void;