sequelize.ts 684 B

123456789101112131415161718
  1. import { Model } from 'sequelize-typescript'
  2. // Thanks to sequelize-typescript: https://github.com/RobinBuschmann/sequelize-typescript
  3. export type Diff<T extends string | symbol | number, U extends string | symbol | number> =
  4. ({ [P in T]: P } & { [P in U]: never } & { [ x: string ]: never })[T]
  5. export type Omit<T, K extends keyof T> = { [P in Diff<keyof T, K>]: T[P] }
  6. export type RecursivePartial<T> = { [P in keyof T]?: RecursivePartial<T[P]> }
  7. export type FilteredModelAttributes<T extends Model<T>> = RecursivePartial<Omit<T, keyof Model<any>>> & {
  8. id?: number | any
  9. createdAt?: Date | any
  10. updatedAt?: Date | any
  11. deletedAt?: Date | any
  12. version?: number | any
  13. }