From e7125bc07acd3c5b10819352ab281199971babb5 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Mon, 30 Oct 2023 19:57:50 +0100 Subject: [PATCH] Added legacy support of lzma --- src/components/TopBar.svelte | 4 ++-- src/globals.d.ts | 2 +- src/lib/lzma.ts | 26 ++++++++++++++++++-------- src/routes/+page.svelte | 26 ++++++++++++++++---------- 4 files changed, 37 insertions(+), 21 deletions(-) diff --git a/src/components/TopBar.svelte b/src/components/TopBar.svelte index 39276da..78d292d 100644 --- a/src/components/TopBar.svelte +++ b/src/components/TopBar.svelte @@ -30,7 +30,7 @@ } onMount(() => { - languages = CodeMirror.modeInfo.map((e) => ({ + languages = CodeMirror.modeInfo.map((e: any) => ({ text: e.name, value: shorten(e.name), data: { mime: e.mime, mode: e.mode }, @@ -64,7 +64,7 @@ } -
+
NoPaste
diff --git a/src/globals.d.ts b/src/globals.d.ts index 101726a..d670a24 100644 --- a/src/globals.d.ts +++ b/src/globals.d.ts @@ -1,7 +1,7 @@ declare class LZMA { constructor(any): {} compress: (value: string, level: number, callback: (result: number[]) => void) => void - decompress: (b: string, callback: (result: any) => void) => void + decompress: (b: Uint8Array, callback: (result: string, err: any) => void) => void } declare const CodeMirror: any diff --git a/src/lib/lzma.ts b/src/lib/lzma.ts index d246ebc..5d02ce6 100644 --- a/src/lib/lzma.ts +++ b/src/lib/lzma.ts @@ -1,23 +1,33 @@ // LZMA imported from