Begin extended implementation

This commit is contained in:
Jaiwanth
2021-06-04 15:08:17 +05:30
parent e7f0df7fcc
commit f32726d5ed
4 changed files with 145 additions and 20 deletions
+11 -4
View File
@@ -1,4 +1,4 @@
import { Room } from 'matrix-js-sdk/src/models/room';
import { Room } from "matrix-js-sdk/src/models/room";
import HTMLExporter from "./HtmlExport";
export enum exportFormats {
@@ -7,14 +7,21 @@ export enum exportFormats {
LOGS = "LOGS",
}
export enum exportOptions {
export enum exportTypes {
TIMELINE = "TIMELINE",
BEGINNING = "BEGINNING",
LAST_N_MESSAGES = "LAST_N_MESSAGES",
}
const exportConversationalHistory = async (room: Room, format: string, options) => {
const exportConversationalHistory = async (
room: Room,
format: string,
exportType: exportTypes,
numberOfEvents?: number,
) => {
switch (format) {
case exportFormats.HTML:
await new HTMLExporter(room).export();
await new HTMLExporter(room, exportType, numberOfEvents).export();
break;
case exportFormats.JSON:
break;