summaryrefslogtreecommitdiff
path: root/src/services/chart/users.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-02-24 12:23:31 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-02-24 12:23:31 +0900
commit5db7b2e193a5d4f26c96eefe3cb19ab214963fc4 (patch)
treeb0a07e4659f4c172ef6977d5bc97b84901fa6de7 /src/services/chart/users.ts
parentResolve audioTag undefined error (#4363) (diff)
downloadsharkey-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.ts57
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');