CODEBASE: Update SaveData type to be compatible with TS 5.9 and upgrade TS (#2457)

This commit is contained in:
catloversg
2026-01-29 03:26:06 +07:00
committed by GitHub
parent afddd284fc
commit 8b07879ad9
9 changed files with 26 additions and 16 deletions
+2 -2
View File
@@ -15,12 +15,12 @@ export function canUseBinaryFormat(): boolean {
return "CompressionStream" in globalThis;
}
async function compress(dataString: string): Promise<Uint8Array> {
async function compress(dataString: string): Promise<Uint8Array<ArrayBuffer>> {
const compressedReadableStream = new Blob([dataString]).stream().pipeThrough(new CompressionStream("gzip"));
return new Uint8Array(await new Response(compressedReadableStream).arrayBuffer());
}
async function decompress(binaryData: Uint8Array): Promise<string> {
async function decompress(binaryData: Uint8Array<ArrayBuffer>): Promise<string> {
const decompressedReadableStream = new Blob([binaryData]).stream().pipeThrough(new DecompressionStream("gzip"));
const reader = decompressedReadableStream.pipeThrough(new TextDecoderStream("utf-8", { fatal: true })).getReader();
let result = "";