aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/user-interface.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/user-interface.ts')
-rw-r--r--server/models/user-interface.ts36
1 files changed, 27 insertions, 9 deletions
diff --git a/server/models/user-interface.ts b/server/models/user-interface.ts
index a504f42a1..98963b743 100644
--- a/server/models/user-interface.ts
+++ b/server/models/user-interface.ts
@@ -1,17 +1,35 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import * as Bluebird from 'bluebird'
3
4// Don't use barrel, import just what we need
5import { User as FormatedUser } from '../../shared/models/user.model'
2 6
3export namespace UserMethods { 7export namespace UserMethods {
4 export type IsPasswordMatch = (password, callback) => void 8 export type IsPasswordMatchCallback = (err: Error, same: boolean) => void
5 export type ToFormatedJSON = () => void 9 export type IsPasswordMatch = (password: string, callback: IsPasswordMatchCallback) => void
10
11 export type ToFormatedJSON = () => FormatedUser
6 export type IsAdmin = () => boolean 12 export type IsAdmin = () => boolean
7 13
8 export type CountTotal = (callback) => void 14 export type CountTotalCallback = (err: Error, total: number) => void
9 export type GetByUsername = (username) => any 15 export type CountTotal = (callback: CountTotalCallback) => void
10 export type List = (callback) => void 16
11 export type ListForApi = (start, count, sort, callback) => void 17 export type GetByUsername = (username: string) => Bluebird<UserInstance>
12 export type LoadById = (id, callback) => void 18
13 export type LoadByUsername = (username, callback) => void 19 export type ListCallback = (err: Error, userInstances: UserInstance[]) => void
14 export type LoadByUsernameOrEmail = (username, email, callback) => void 20 export type List = (callback: ListCallback) => void
21
22 export type ListForApiCallback = (err: Error, userInstances?: UserInstance[], total?: number) => void
23 export type ListForApi = (start: number, count: number, sort: string, callback: ListForApiCallback) => void
24
25 export type LoadByIdCallback = (err: Error, userInstance: UserInstance) => void
26 export type LoadById = (id: number, callback: LoadByIdCallback) => void
27
28 export type LoadByUsernameCallback = (err: Error, userInstance: UserInstance) => void
29 export type LoadByUsername = (username: string, callback: LoadByUsernameCallback) => void
30
31 export type LoadByUsernameOrEmailCallback = (err: Error, userInstance: UserInstance) => void
32 export type LoadByUsernameOrEmail = (username: string, email: string, callback: LoadByUsernameOrEmailCallback) => void
15} 33}
16 34
17export interface UserClass { 35export interface UserClass {