From 04d0b00b957d71d75387fefafd0162058af283d4 Mon Sep 17 00:00:00 2001 From: Gabriel Gomes Date: Fri, 28 Mar 2025 01:43:05 +0000 Subject: [PATCH] Changed global file for iTXt --- packages/excalidraw/global.d.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/excalidraw/global.d.ts b/packages/excalidraw/global.d.ts index e9b6c3f96..f3c2e2f26 100644 --- a/packages/excalidraw/global.d.ts +++ b/packages/excalidraw/global.d.ts @@ -33,6 +33,7 @@ interface Clipboard extends EventTarget { // PNG encoding/decoding // ----------------------------------------------------------------------------- type TEXtChunk = { name: "tEXt"; data: Uint8Array }; +type ITXtChunk = { name: "iTXt"; data: Uint8Array }; declare module "png-chunk-text" { function encode( @@ -41,12 +42,29 @@ declare module "png-chunk-text" { ): { name: "tEXt"; data: Uint8Array }; function decode(data: Uint8Array): { keyword: string; text: string }; } + +declare module "png-chunk-itxt" { + function encode( + keyword: string, + text: string, + options?: { compressed?: boolean; language?: string; translated?: string }, + ): { name: "iTXt"; data: Uint8Array }; + function decode(data: Uint8Array): { + keyword: string; + text: string; + language?: string; + translated?: string; + }; + export { encode, decode }; +} + declare module "png-chunks-encode" { - function encode(chunks: TEXtChunk[]): Uint8Array; + function encode(chunks: (TEXtChunk | ITXtChunk)[]): Uint8Array; export = encode; } + declare module "png-chunks-extract" { - function extract(buffer: Uint8Array): TEXtChunk[]; + function extract(buffer: Uint8Array): (TEXtChunk | ITXtChunk)[]; export = extract; } // -----------------------------------------------------------------------------