diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-23 09:50:57 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-24 16:26:21 +0200 |
commit | 3acc50844047a37698f0618fa235c138e386a053 (patch) | |
tree | e33243bf7fadbcf2df616fc41814245094fd881a /server/typings | |
parent | 1735c825726edaa0af5035cb6cbb0cc0db502c6d (diff) | |
download | PeerTube-3acc50844047a37698f0618fa235c138e386a053.tar.gz PeerTube-3acc50844047a37698f0618fa235c138e386a053.tar.zst PeerTube-3acc50844047a37698f0618fa235c138e386a053.zip |
Upgrade sequelize
Diffstat (limited to 'server/typings')
-rw-r--r-- | server/typings/sequelize.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server/typings/sequelize.ts b/server/typings/sequelize.ts new file mode 100644 index 000000000..9cd83612d --- /dev/null +++ b/server/typings/sequelize.ts | |||
@@ -0,0 +1,18 @@ | |||
1 | import { Model } from 'sequelize-typescript' | ||
2 | |||
3 | // Thanks to sequelize-typescript: https://github.com/RobinBuschmann/sequelize-typescript | ||
4 | |||
5 | export type Diff<T extends string | symbol | number, U extends string | symbol | number> = | ||
6 | ({ [P in T]: P } & { [P in U]: never } & { [ x: string ]: never })[T] | ||
7 | |||
8 | export type Omit<T, K extends keyof T> = { [P in Diff<keyof T, K>]: T[P] } | ||
9 | |||
10 | export type RecursivePartial<T> = { [P in keyof T]?: RecursivePartial<T[P]> } | ||
11 | |||
12 | export type FilteredModelAttributes<T extends Model<T>> = RecursivePartial<Omit<T, keyof Model<any>>> & { | ||
13 | id?: number | any | ||
14 | createdAt?: Date | any | ||
15 | updatedAt?: Date | any | ||
16 | deletedAt?: Date | any | ||
17 | version?: number | any | ||
18 | } | ||