fix(database): typings
This commit is contained in:
parent
86e0f071e4
commit
9c422b7879
@ -1,14 +1,11 @@
|
|||||||
import merge from 'deepmerge';
|
import merge from 'deepmerge';
|
||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
import { default as lodash, default as _ } from 'lodash';
|
import { default as lodash, default as _ } from 'lodash';
|
||||||
import { Model, ModelCtor, ModelOptions } from 'sequelize';
|
import { Model, ModelCtor, ModelOptions, SyncOptions } from 'sequelize';
|
||||||
import { SyncOptions } from 'sequelize/types/lib/sequelize';
|
|
||||||
import { Database } from './database';
|
import { Database } from './database';
|
||||||
import { Field, FieldOptions } from './fields';
|
import { Field, FieldOptions } from './fields';
|
||||||
import { Repository } from './repository';
|
import { Repository } from './repository';
|
||||||
|
|
||||||
const { hooks } = require('sequelize/lib/hooks');
|
|
||||||
|
|
||||||
export type RepositoryType = typeof Repository;
|
export type RepositoryType = typeof Repository;
|
||||||
|
|
||||||
export type CollectionSortable = string | boolean | { name?: string; scopeKey?: string };
|
export type CollectionSortable = string | boolean | { name?: string; scopeKey?: string };
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
import { omit } from 'lodash';
|
import { omit } from 'lodash';
|
||||||
import { Sequelize, ModelCtor, Model, DataTypes, Utils } from 'sequelize';
|
import { BelongsToOptions as SequelizeBelongsToOptions, Utils } from 'sequelize';
|
||||||
import { BaseRelationFieldOptions, RelationField } from './relation-field';
|
import { BaseRelationFieldOptions, RelationField } from './relation-field';
|
||||||
import { HasInverseField } from './has-inverse-field';
|
|
||||||
import { BaseColumnFieldOptions, Field } from './field';
|
|
||||||
import { HasManyField } from './has-many-field';
|
|
||||||
import { BelongsToOptions as SequelizeBelongsToOptions } from 'sequelize/types/lib/associations/belongs-to';
|
|
||||||
|
|
||||||
export class BelongsToField extends RelationField {
|
export class BelongsToField extends RelationField {
|
||||||
static type = 'belongsTo';
|
static type = 'belongsTo';
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import { omit } from 'lodash';
|
import { omit } from 'lodash';
|
||||||
import { Sequelize, ModelCtor, Model, DataTypes, Utils } from 'sequelize';
|
import { BelongsToManyOptions as SequelizeBelongsToManyOptions } from 'sequelize';
|
||||||
import { Collection } from '../collection';
|
import { Collection } from '../collection';
|
||||||
import { BaseRelationFieldOptions, RelationField } from './relation-field';
|
import { BaseRelationFieldOptions, RelationField } from './relation-field';
|
||||||
import { BaseColumnFieldOptions } from './field';
|
|
||||||
import { BelongsToManyOptions as SequelizeBelongsToManyOptions } from 'sequelize/types/lib/associations/belongs-to-many';
|
|
||||||
|
|
||||||
export class BelongsToManyField extends RelationField {
|
export class BelongsToManyField extends RelationField {
|
||||||
get through() {
|
get through() {
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
import { omit } from 'lodash';
|
import { omit } from 'lodash';
|
||||||
import {
|
import {
|
||||||
Sequelize,
|
|
||||||
ModelCtor,
|
|
||||||
Model,
|
|
||||||
DataType,
|
|
||||||
AssociationScope,
|
AssociationScope,
|
||||||
|
DataType,
|
||||||
ForeignKeyOptions,
|
ForeignKeyOptions,
|
||||||
HasManyOptions,
|
HasManyOptions,
|
||||||
Utils,
|
HasManyOptions as SequelizeHasManyOptions,
|
||||||
|
Utils
|
||||||
} from 'sequelize';
|
} from 'sequelize';
|
||||||
import { BaseRelationFieldOptions, RelationField } from './relation-field';
|
import { BaseRelationFieldOptions, RelationField } from './relation-field';
|
||||||
import { BaseColumnFieldOptions } from './field';
|
|
||||||
import { HasManyOptions as SequelizeHasManyOptions } from 'sequelize/types/lib/associations/has-many';
|
|
||||||
|
|
||||||
export interface HasManyFieldOptions extends HasManyOptions {
|
export interface HasManyFieldOptions extends HasManyOptions {
|
||||||
/**
|
/**
|
||||||
|
@ -1,17 +1,13 @@
|
|||||||
import { omit } from 'lodash';
|
import { omit } from 'lodash';
|
||||||
import {
|
import {
|
||||||
Sequelize,
|
|
||||||
ModelCtor,
|
|
||||||
Model,
|
|
||||||
DataType,
|
|
||||||
AssociationScope,
|
AssociationScope,
|
||||||
|
DataType,
|
||||||
ForeignKeyOptions,
|
ForeignKeyOptions,
|
||||||
HasOneOptions,
|
HasOneOptions,
|
||||||
Utils,
|
HasOneOptions as SequelizeHasOneOptions,
|
||||||
|
Utils
|
||||||
} from 'sequelize';
|
} from 'sequelize';
|
||||||
import { BaseRelationFieldOptions, RelationField } from './relation-field';
|
import { BaseRelationFieldOptions, RelationField } from './relation-field';
|
||||||
import { BaseColumnFieldOptions } from './field';
|
|
||||||
import { HasOneOptions as SequelizeHasOneOptions } from 'sequelize/types/lib/associations/has-one';
|
|
||||||
|
|
||||||
export interface HasOneFieldOptions extends HasOneOptions {
|
export interface HasOneFieldOptions extends HasOneOptions {
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import Database from './database';
|
|
||||||
import lodash from 'lodash';
|
import lodash from 'lodash';
|
||||||
import { Model } from 'sequelize';
|
import { Model } from 'sequelize';
|
||||||
import { SequelizeHooks } from 'sequelize/types/lib/hooks';
|
import type { SequelizeHooks } from 'sequelize/types/lib/hooks';
|
||||||
|
import Database from './database';
|
||||||
|
|
||||||
const { hooks } = require('sequelize/lib/hooks');
|
const { hooks } = require('sequelize/lib/hooks');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user