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