From 37b4f5d96aedc99160ac7a1073d275f410d8a37c Mon Sep 17 00:00:00 2001 From: pinks Date: Mon, 18 Sep 2023 00:35:12 +0200 Subject: [PATCH] remove types --- common/parsePngInfo.ts | 6 +++--- deps.ts | 8 +++----- types/png-chunk-text.d.ts | 2 -- types/png-chunks-encode.d.ts | 1 - types/png-chunks-extract.d.ts | 1 - 5 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 types/png-chunk-text.d.ts delete mode 100644 types/png-chunks-encode.d.ts delete mode 100644 types/png-chunks-extract.d.ts diff --git a/common/parsePngInfo.ts b/common/parsePngInfo.ts index 49d9bda..17aaee6 100644 --- a/common/parsePngInfo.ts +++ b/common/parsePngInfo.ts @@ -1,9 +1,9 @@ -import { PngChunksExtract, PngChunkText } from "../deps.ts"; +import { pngChunksExtract, pngChunkTextDecode } from "../deps.ts"; export function getPngInfo(pngData: Uint8Array): string | undefined { - return PngChunksExtract.default(pngData) + return pngChunksExtract(pngData) .filter((chunk) => chunk.name === "tEXt") - .map((chunk) => PngChunkText.decode(chunk.data)) + .map((chunk) => pngChunkTextDecode(chunk.data)) .find((textChunk) => textChunk.keyword === "parameters") ?.text; } diff --git a/deps.ts b/deps.ts index abade59..9d45cfe 100644 --- a/deps.ts +++ b/deps.ts @@ -13,8 +13,6 @@ export * as GrammyParseMode from "https://deno.land/x/grammy_parse_mode@1.7.1/mo export * as GrammyKvStorage from "https://deno.land/x/grammy_storages@v2.3.1/denokv/src/mod.ts"; export * as GrammyStatelessQ from "https://deno.land/x/grammy_stateless_question_alpha@v3.0.3/mod.ts"; export * as GrammyFiles from "https://deno.land/x/grammy_files@v1.0.4/mod.ts"; -export * as FileType from "npm:file-type@18.5.0"; -// @deno-types="./types/png-chunks-extract.d.ts" -export * as PngChunksExtract from "npm:png-chunks-extract@1.0.0"; -// @deno-types="./types/png-chunk-text.d.ts" -export * as PngChunkText from "npm:png-chunk-text@1.0.0"; +export * as FileType from "https://esm.sh/file-type@18.5.0"; +export { default as pngChunksExtract } from "https://esm.sh/png-chunks-extract@1.0.0"; +export { decode as pngChunkTextDecode } from "https://esm.sh/png-chunk-text@1.0.0"; diff --git a/types/png-chunk-text.d.ts b/types/png-chunk-text.d.ts deleted file mode 100644 index cb2adfb..0000000 --- a/types/png-chunk-text.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export function decode(chunk: Uint8Array): { keyword: string; text: string }; -export function encode(keyword: string, text: string): Uint8Array; diff --git a/types/png-chunks-encode.d.ts b/types/png-chunks-encode.d.ts deleted file mode 100644 index 4267e6d..0000000 --- a/types/png-chunks-encode.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function encode(chunks: Array<{ name: string; data: Uint8Array }>): Uint8Array; diff --git a/types/png-chunks-extract.d.ts b/types/png-chunks-extract.d.ts deleted file mode 100644 index daee7c8..0000000 --- a/types/png-chunks-extract.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function extract(data: Uint8Array): Array<{ name: string; data: Uint8Array }>;