2021-06-26 13:04:10 +05:30
|
|
|
import { _t } from "../../languageHandler";
|
2021-05-22 11:32:55 +05:30
|
|
|
|
2021-05-24 18:01:09 +05:30
|
|
|
export enum exportFormats {
|
|
|
|
|
HTML = "HTML",
|
2021-06-26 21:53:50 +05:30
|
|
|
PLAIN_TEXT = "PLAIN_TEXT",
|
2021-06-26 23:08:37 +05:30
|
|
|
JSON = "JSON",
|
2021-05-24 18:01:09 +05:30
|
|
|
}
|
2021-05-22 11:32:55 +05:30
|
|
|
|
2021-06-04 15:08:17 +05:30
|
|
|
export enum exportTypes {
|
2021-06-26 21:53:50 +05:30
|
|
|
TIMELINE = "TIMELINE",
|
|
|
|
|
BEGINNING = "BEGINNING",
|
|
|
|
|
// START_DATE = "START_DATE",
|
|
|
|
|
LAST_N_MESSAGES = "LAST_N_MESSAGES",
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-29 10:13:51 +05:30
|
|
|
export const textForFormat = (format: string): string => {
|
2021-06-26 21:53:50 +05:30
|
|
|
switch (format) {
|
|
|
|
|
case exportFormats.HTML:
|
|
|
|
|
return _t("HTML");
|
|
|
|
|
case exportFormats.JSON:
|
|
|
|
|
return _t("JSON");
|
|
|
|
|
case exportFormats.PLAIN_TEXT:
|
|
|
|
|
return _t("Plain Text");
|
|
|
|
|
}
|
2021-06-30 14:08:22 +05:30
|
|
|
};
|
2021-06-26 21:53:50 +05:30
|
|
|
|
2021-06-29 10:14:00 +05:30
|
|
|
export const textForType = (type: string): string => {
|
2021-06-26 21:53:50 +05:30
|
|
|
switch (type) {
|
|
|
|
|
case exportTypes.BEGINNING:
|
|
|
|
|
return _t("From the beginning");
|
|
|
|
|
case exportTypes.LAST_N_MESSAGES:
|
2021-07-26 00:09:59 +05:30
|
|
|
return _t("Specify a number of messages");
|
2021-06-26 21:53:50 +05:30
|
|
|
case exportTypes.TIMELINE:
|
|
|
|
|
return _t("Current Timeline");
|
|
|
|
|
// case exportTypes.START_DATE:
|
|
|
|
|
// return _t("From a specific date");
|
|
|
|
|
}
|
2021-06-30 14:08:22 +05:30
|
|
|
};
|
2021-05-22 11:32:55 +05:30
|
|
|
|
2021-06-11 12:04:05 +05:30
|
|
|
export interface exportOptions {
|
|
|
|
|
startDate?: number;
|
|
|
|
|
numberOfMessages?: number;
|
2021-06-14 11:08:17 +05:30
|
|
|
attachmentsIncluded: boolean;
|
2021-06-15 16:41:31 +05:30
|
|
|
maxSize: number;
|
2021-06-11 12:04:05 +05:30
|
|
|
}
|