diff --git a/src/transform/plugins/images/index.ts b/src/transform/plugins/images/index.ts index 0d976dbd..e0d23a04 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 14eee4cd..97a00838 100644 --- a/src/transform/yfmlint/index.ts +++ b/src/transform/yfmlint/index.ts @@ -111,9 +111,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; }