diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-22 20:58:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-25 17:32:16 +0200 |
commit | e02643f32e4c97ca307f8fc5b69be79c40d70a3b (patch) | |
tree | b7f6269913cd5a0e4f26a9461a043deb0c168be0 /server/models/application-interface.ts | |
parent | 65fcc3119c334b75dd13bcfdebf186afdc580a8f (diff) | |
download | PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.gz PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.zst PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.zip |
Type models
Diffstat (limited to 'server/models/application-interface.ts')
-rw-r--r-- | server/models/application-interface.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/server/models/application-interface.ts b/server/models/application-interface.ts new file mode 100644 index 000000000..826d25df0 --- /dev/null +++ b/server/models/application-interface.ts | |||
@@ -0,0 +1,23 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | export namespace ApplicationMethods { | ||
4 | export type LoadMigrationVersion = (callback: (err: Error, version: number) => void) => void | ||
5 | export type UpdateMigrationVersion = (newVersion: number, transaction: any, callback: any) => void | ||
6 | } | ||
7 | |||
8 | export interface ApplicationClass { | ||
9 | loadMigrationVersion: ApplicationMethods.LoadMigrationVersion | ||
10 | updateMigrationVersion: ApplicationMethods.UpdateMigrationVersion | ||
11 | } | ||
12 | |||
13 | export interface ApplicationAttributes { | ||
14 | migrationVersion: number | ||
15 | } | ||
16 | |||
17 | export interface ApplicationInstance extends ApplicationClass, ApplicationAttributes, Sequelize.Instance<ApplicationAttributes> { | ||
18 | id: number | ||
19 | createdAt: Date | ||
20 | updatedAt: Date | ||
21 | } | ||
22 | |||
23 | export interface ApplicationModel extends ApplicationClass, Sequelize.Model<ApplicationInstance, ApplicationAttributes> {} | ||