|
|
@ -2,26 +2,30 @@ export type Label = {[key: string]: number} |
|
|
|
|
|
|
|
export type User = {[key: string]: number} |
|
|
|
|
|
|
|
export type ConfirmedCount = {[key: string]: number} |
|
|
|
|
|
|
|
export class Statistics { |
|
|
|
constructor( |
|
|
|
public label: Label, |
|
|
|
public userLabel: User, |
|
|
|
public total: number, |
|
|
|
public remaining: number, |
|
|
|
public user: User |
|
|
|
public user: User, |
|
|
|
public confirmedCount: ConfirmedCount, |
|
|
|
) {} |
|
|
|
|
|
|
|
static valueOf( |
|
|
|
{ label, user_label, total, remaining, user }: |
|
|
|
{ label, user_label, total, remaining, user, confirmed_count }: |
|
|
|
{ |
|
|
|
label: Label, |
|
|
|
user_label: User, |
|
|
|
total: number, |
|
|
|
remaining: number, |
|
|
|
user: User |
|
|
|
user: User, |
|
|
|
confirmed_count: ConfirmedCount, |
|
|
|
} |
|
|
|
): Statistics { |
|
|
|
return new Statistics(label, user_label, total, remaining, user) |
|
|
|
return new Statistics(label, user_label, total, remaining, user, confirmed_count) |
|
|
|
} |
|
|
|
|
|
|
|
private makeData(object: Label | User, label: string) { |
|
|
|