Skip to content

Commit

Permalink
fix: <T> extends string ? string[] : Uint8Array[]
Browse files Browse the repository at this point in the history
  • Loading branch information
sj817 committed Nov 11, 2024
1 parent 8b1f6d3 commit 40b3850
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/puppeteer/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ export interface screenshot extends ScreenshotOptions {

/** 截图返回 */
export type RenderEncoding<T extends screenshot> = T['encoding'] extends 'base64' ? string : Uint8Array
export type RenderResult<T extends screenshot> = T['multiPage'] extends true | number ? RenderEncoding<T>[] : RenderEncoding<T>
/** 单页或多页截图返回 */
export type RenderResult<T extends screenshot> = T['multiPage'] extends true | number
? RenderEncoding<T> extends string ? string[] : Uint8Array[]
: RenderEncoding<T>

export class Render {
/** 浏览器id */
Expand Down

0 comments on commit 40b3850

Please sign in to comment.