diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-02-24 10:00:24 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-02-24 10:00:24 +0900 |
| commit | a55d5516a6dc5c85e6d8fe196d419981c1c829f4 (patch) | |
| tree | 5144e0aaf18a5015d5dbc52ab2122176039ccbf1 /src/services/chart | |
| parent | Improve type definitions (diff) | |
| download | misskey-a55d5516a6dc5c85e6d8fe196d419981c1c829f4.tar.gz misskey-a55d5516a6dc5c85e6d8fe196d419981c1c829f4.tar.bz2 misskey-a55d5516a6dc5c85e6d8fe196d419981c1c829f4.zip | |
Improve doc
Diffstat (limited to 'src/services/chart')
| -rw-r--r-- | src/services/chart/drive.ts | 90 |
1 files changed, 59 insertions, 31 deletions
diff --git a/src/services/chart/drive.ts b/src/services/chart/drive.ts index 972f8c5709..d8465fbd4a 100644 --- a/src/services/chart/drive.ts +++ b/src/services/chart/drive.ts @@ -2,46 +2,74 @@ import autobind from 'autobind-decorator'; import Chart, { Obj } from './'; import DriveFile, { IDriveFile } from '../../models/drive-file'; import { isLocalUser } from '../../models/user'; +import { SchemaType } from '../../prelude/schema'; -/** - * ドライブに関するチャート - */ -type DriveLog = { - local: { - /** - * 集計期間時点での、全ドライブファイル数 - */ - totalCount: number; +const logSchema = { + /** + * 集計期間時点での、全ドライブファイル数 + */ + totalCount: { + type: 'number' as 'number', + description: '集計期間時点での、全ドライブファイル数' + }, - /** - * 集計期間時点での、全ドライブファイルの合計サイズ - */ - totalSize: number; + /** + * 集計期間時点での、全ドライブファイルの合計サイズ + */ + totalSize: { + type: 'number' as 'number', + description: '集計期間時点での、全ドライブファイルの合計サイズ' + }, - /** - * 増加したドライブファイル数 - */ - incCount: number; + /** + * 増加したドライブファイル数 + */ + incCount: { + type: 'number' as 'number', + description: '増加したドライブファイル数' + }, - /** - * 増加したドライブ使用量 - */ - incSize: number; + /** + * 増加したドライブ使用量 + */ + incSize: { + type: 'number' as 'number', + description: '増加したドライブ使用量' + }, - /** - * 減少したドライブファイル数 - */ - decCount: number; + /** + * 減少したドライブファイル数 + */ + decCount: { + type: 'number' as 'number', + description: '減少したドライブファイル数' + }, - /** - * 減少したドライブ使用量 - */ - decSize: number; - }; + /** + * 減少したドライブ使用量 + */ + decSize: { + type: 'number' as 'number', + description: '減少したドライブ使用量' + }, +}; - remote: DriveLog['local']; +export const driveLogSchema = { + type: 'object' as 'object', + properties: { + local: { + type: 'object' as 'object', + properties: logSchema + }, + remote: { + type: 'object' as 'object', + properties: logSchema + }, + } }; +type DriveLog = SchemaType<typeof driveLogSchema>; + class DriveChart extends Chart<DriveLog> { constructor() { super('drive'); |