From 40b3850fef8dea074c915febd7d53cbf578c404b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E7=91=BE?= Date: Mon, 11 Nov 2024 23:27:34 +0800 Subject: [PATCH] fix: extends string ? string[] : Uint8Array[] --- src/puppeteer/core.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/puppeteer/core.ts b/src/puppeteer/core.ts index faf0f67..3a1bdc8 100644 --- a/src/puppeteer/core.ts +++ b/src/puppeteer/core.ts @@ -82,7 +82,10 @@ export interface screenshot extends ScreenshotOptions { /** 截图返回 */ export type RenderEncoding = T['encoding'] extends 'base64' ? string : Uint8Array -export type RenderResult = T['multiPage'] extends true | number ? RenderEncoding[] : RenderEncoding +/** 单页或多页截图返回 */ +export type RenderResult = T['multiPage'] extends true | number + ? RenderEncoding extends string ? string[] : Uint8Array[] + : RenderEncoding export class Render { /** 浏览器id */