diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-02-24 12:23:31 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-02-24 12:23:31 +0900 |
| commit | 5db7b2e193a5d4f26c96eefe3cb19ab214963fc4 (patch) | |
| tree | b0a07e4659f4c172ef6977d5bc97b84901fa6de7 /src/services/chart/users.ts | |
| parent | Resolve audioTag undefined error (#4363) (diff) | |
| download | sharkey-5db7b2e193a5d4f26c96eefe3cb19ab214963fc4.tar.gz sharkey-5db7b2e193a5d4f26c96eefe3cb19ab214963fc4.tar.bz2 sharkey-5db7b2e193a5d4f26c96eefe3cb19ab214963fc4.zip | |
Improve doc
Diffstat (limited to 'src/services/chart/users.ts')
| -rw-r--r-- | src/services/chart/users.ts | 57 |
1 files changed, 38 insertions, 19 deletions
diff --git a/src/services/chart/users.ts b/src/services/chart/users.ts index ce23209aea..0cb3711f95 100644 --- a/src/services/chart/users.ts +++ b/src/services/chart/users.ts @@ -1,31 +1,50 @@ import autobind from 'autobind-decorator'; import Chart, { Obj } from './'; import User, { IUser, isLocalUser } from '../../models/user'; +import { SchemaType } from '../../prelude/schema'; -/** - * ユーザーに関するチャート - */ -type UsersLog = { - local: { - /** - * 集計期間時点での、全ユーザー数 - */ - total: number; +const logSchema = { + /** + * 集計期間時点での、全ユーザー数 + */ + total: { + type: 'number' as 'number', + description: '集計期間時点での、全ユーザー数' + }, - /** - * 増加したユーザー数 - */ - inc: number; + /** + * 増加したユーザー数 + */ + inc: { + type: 'number' as 'number', + description: '増加したユーザー数' + }, - /** - * 減少したユーザー数 - */ - dec: number; - }; + /** + * 減少したユーザー数 + */ + dec: { + type: 'number' as 'number', + description: '減少したユーザー数' + }, +}; - remote: UsersLog['local']; +export const usersLogSchema = { + type: 'object' as 'object', + properties: { + local: { + type: 'object' as 'object', + properties: logSchema + }, + remote: { + type: 'object' as 'object', + properties: logSchema + }, + } }; +type UsersLog = SchemaType<typeof usersLogSchema>; + class UsersChart extends Chart<UsersLog> { constructor() { super('users'); |