Improve doc

This commit is contained in:
syuilo 2019-02-25 04:02:18 +09:00
parent eb8d1211ba
commit 47d4dcfdf5
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
2 changed files with 63 additions and 33 deletions

View file

@ -2,56 +2,90 @@ import autobind from 'autobind-decorator';
import Chart, { Obj } from './';
import Following from '../../models/following';
import { IUser, isLocalUser } from '../../models/user';
import { SchemaType } from '../../misc/schema';
/**
*
*/
type PerUserFollowingLog = {
local: {
/**
*
*/
followings: {
export const logSchema = {
/**
*
*/
followings: {
type: 'object' as 'object',
properties: {
/**
*
*
*/
total: number;
total: {
type: 'number',
description: 'フォローしている合計',
},
/**
*
*/
inc: number;
inc: {
type: 'number',
description: 'フォローした数',
},
/**
*
*/
dec: number;
};
dec: {
type: 'number',
description: 'フォロー解除した数',
},
}
},
/**
*
*/
followers: {
/**
*
*/
followers: {
type: 'object' as 'object',
properties: {
/**
*
*
*/
total: number;
total: {
type: 'number',
description: 'フォローされている合計',
},
/**
*
*/
inc: number;
inc: {
type: 'number',
description: 'フォローされた数',
},
/**
*
*/
dec: number;
};
};
remote: PerUserFollowingLog['local'];
dec: {
type: 'number',
description: 'フォロー解除された数',
},
}
},
};
export const perUserFollowingLogSchema = {
type: 'object' as 'object',
properties: {
local: {
type: 'object' as 'object',
properties: logSchema
},
remote: {
type: 'object' as 'object',
properties: logSchema
},
}
};
type PerUserFollowingLog = SchemaType<typeof perUserFollowingLogSchema>;
class PerUserFollowingChart extends Chart<PerUserFollowingLog> {
constructor() {
super('perUserFollowing', true);