File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,16 @@ import { \
12
12
Image as NativeImage, \
13
13
loadImage, \
14
14
registerFont as loadFont, \
15
- type Canvas as NativeCanvas, \
16
- type CanvasRenderingContext2D as NativeCanvasRenderingContext2D, \
17
15
type ImageData, \
18
16
type JpegConfig, \
19
17
type JPEGStream, \
20
- type PdfConfig, \
18
+ type Canvas as NativeCanvas, \
19
+ type CanvasRenderingContext2D as NativeCanvasRenderingContext2D, \
21
20
type PDFStream, \
21
+ type PNGStream, \
22
+ type PdfConfig, \
22
23
type PngConfig, \
23
- type PNGStream \
24
+ type TextMetrics \
24
25
} from 'canvas';
25
26
// IF(NAPI_RS): \
26
27
import { \
@@ -2152,11 +2153,14 @@ export class Canvas {
2152
2153
public toBufferAsync(mimeType: 'application/pdf', config?: PdfConfig): Promise<Buffer>; \
2153
2154
public toBufferAsync(...args: readonly any[]): Promise<Buffer> { \
2154
2155
return new Promise<Buffer>((resolve, reject) => \
2155
- // @ts-expect-error: Complains about invalid overload (expects more than 0 overloads). \
2156
- this.canvas.toBuffer((error: Error | null, buffer: Buffer | null): void => { \
2157
- if (error) reject(error); \
2158
- else resolve(buffer!); \
2159
- }, ...args) \
2156
+ this.canvas.toBuffer( \
2157
+ // @ts-expect-error: Complains about invalid overload (expects more than 0 overloads). \
2158
+ (error: Error | null, buffer: Buffer | null): void => { \
2159
+ if (error) reject(error); \
2160
+ else resolve(buffer!); \
2161
+ }, \
2162
+ ...args \
2163
+ ) \
2160
2164
); \
2161
2165
}
2162
2166
// IF(SKIA): \
You can’t perform that action at this time.
0 commit comments