diff --git a/src/main.ts.template b/src/main.ts.template index 962d3480..51f7eddb 100644 --- a/src/main.ts.template +++ b/src/main.ts.template @@ -12,15 +12,16 @@ import { \ Image as NativeImage, \ loadImage, \ registerFont as loadFont, \ - type Canvas as NativeCanvas, \ - type CanvasRenderingContext2D as NativeCanvasRenderingContext2D, \ type ImageData, \ type JpegConfig, \ type JPEGStream, \ - type PdfConfig, \ + type Canvas as NativeCanvas, \ + type CanvasRenderingContext2D as NativeCanvasRenderingContext2D, \ type PDFStream, \ + type PNGStream, \ + type PdfConfig, \ type PngConfig, \ - type PNGStream \ + type TextMetrics \ } from 'canvas'; // IF(NAPI_RS): \ import { \ @@ -2152,11 +2153,14 @@ export class Canvas { public toBufferAsync(mimeType: 'application/pdf', config?: PdfConfig): Promise; \ public toBufferAsync(...args: readonly any[]): Promise { \ return new Promise((resolve, reject) => \ - // @ts-expect-error: Complains about invalid overload (expects more than 0 overloads). \ - this.canvas.toBuffer((error: Error | null, buffer: Buffer | null): void => { \ - if (error) reject(error); \ - else resolve(buffer!); \ - }, ...args) \ + this.canvas.toBuffer( \ + // @ts-expect-error: Complains about invalid overload (expects more than 0 overloads). \ + (error: Error | null, buffer: Buffer | null): void => { \ + if (error) reject(error); \ + else resolve(buffer!); \ + }, \ + ...args \ + ) \ ); \ } // IF(SKIA): \