From e775033c6d7f9d0e50616a459486b2fb12768a06 Mon Sep 17 00:00:00 2001 From: Anton Vikulov Date: Wed, 20 Sep 2023 08:26:08 +0500 Subject: [PATCH] types upd --- src/transform/plugins/images/index.ts | 2 +- src/transform/utilsFS.ts | 2 +- src/transform/yfmlint/index.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/transform/plugins/images/index.ts b/src/transform/plugins/images/index.ts index 3df6bea9..9f269642 100644 --- a/src/transform/plugins/images/index.ts +++ b/src/transform/plugins/images/index.ts @@ -63,7 +63,7 @@ function convertSvg( try { let content: string; if (envApi) { - content = envApi?.readFile(relative(root, path), 'utf8'); + content = envApi?.readFile(relative(root, path), 'utf8') as string; } else { content = readFileSync(path, 'utf8'); } diff --git a/src/transform/utilsFS.ts b/src/transform/utilsFS.ts index 5078e209..70738d5f 100644 --- a/src/transform/utilsFS.ts +++ b/src/transform/utilsFS.ts @@ -61,7 +61,7 @@ export function getFileTokens(path: string, state: StateCore, options: GetFileTo } if (envApi) { - content = envApi.readFile(relative(envApi.root, path), 'utf-8'); + content = envApi.readFile(relative(envApi.root, path), 'utf-8') as string; } else if (filesCache[path]) { content = filesCache[path]; } else { diff --git a/src/transform/yfmlint/index.ts b/src/transform/yfmlint/index.ts index 7f2c5836..70a2aed9 100644 --- a/src/transform/yfmlint/index.ts +++ b/src/transform/yfmlint/index.ts @@ -110,9 +110,9 @@ namespace yfmlint { distRoot: string; copyFile: (from: string, to: string) => void; copyFileAsync: (from: string, to: string) => void; - writeFile: (to: string, data: string) => void; - writeFileAsync: (to: string, data: string) => void; - readFile: (path: string, encoding: BufferEncoding) => string; + writeFile: (to: string, data: string | Uint8Array) => void; + writeFileAsync: (to: string, data: string | Uint8Array) => void; + readFile: (path: string, encoding: BufferEncoding) => string | Uint8Array; fileExists: (path: string) => boolean; getFileVars: (path: string) => Record; }