feat(dm): more stats
This commit is contained in:
parent
d9268a4991
commit
dbd0b12b3d
19 changed files with 798 additions and 1106 deletions
36
src/types.ts
Normal file
36
src/types.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
export type MessageOverview =
|
||||
| {
|
||||
messageDate: Date;
|
||||
fromRecipientId: number;
|
||||
}[]
|
||||
| undefined;
|
||||
|
||||
export type Recipients = {
|
||||
recipientId: number;
|
||||
name: string;
|
||||
}[];
|
||||
|
||||
export type MessageStats = {
|
||||
// indexed by recipientId
|
||||
person: {
|
||||
[recipientId: number]: number;
|
||||
};
|
||||
// month from 0 to 11 = from January to December, each month indexed by recipientId
|
||||
month: {
|
||||
[recipientId: number]: number;
|
||||
}[];
|
||||
// every date of the chat history, indexed by the date string
|
||||
date: {
|
||||
[recipientId: number]: number;
|
||||
date: Date;
|
||||
totalMessages: number;
|
||||
}[];
|
||||
// weekdays from 0 to 6 = from Monday to Sunday (not from Sunday to Saturday as in the `Date` object), each weekday indexed by recipientId
|
||||
weekday: {
|
||||
[recipientId: number]: number;
|
||||
}[];
|
||||
// hours of the day from 0 - 23, each hour indexed by recipientId
|
||||
daytime: {
|
||||
[recipientId: number]: number;
|
||||
}[];
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue