Skip to content

Commit 65f4027

Browse files
authored
Fixes to types (#3302)
1 parent f5a19b0 commit 65f4027

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

types/index.d.ts

+22-2
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,15 @@ declare module "jspdf" {
169169
): HTMLWorker;
170170
progress: HTMLWorkerProgress;
171171
error(msg: string): void;
172-
save(filename: string): void;
172+
save(filename: string): Promise<void>;
173173
set(opt: HTMLOptions): HTMLWorker;
174174
get(key: "string"): HTMLWorker;
175175
get(key: "string", cbk: (value: string) => void): string;
176+
doCallback(): Promise<void>;
177+
outputImg(
178+
type: "img" | "datauristring" | "dataurlstring" | "datauri" | "dataurl"
179+
): Promise<string>;
180+
outputPdf: jsPDF["output"];
176181
}
177182

178183
export interface HTMLOptionImage {
@@ -502,6 +507,19 @@ declare module "jspdf" {
502507
| "Separation"
503508
| "DeviceN";
504509

510+
export type ImageFormat =
511+
| "RGBA"
512+
| "UNKNOWN"
513+
| "PNG"
514+
| "TIFF"
515+
| "JPG"
516+
| "JPEG"
517+
| "JPEG2000"
518+
| "GIF87a"
519+
| "GIF89a"
520+
| "WEBP"
521+
| "BMP";
522+
505523
export interface ImageOptions {
506524
imageData:
507525
| string
@@ -516,6 +534,7 @@ declare module "jspdf" {
516534
alias?: string;
517535
compression?: ImageCompression;
518536
rotation?: number;
537+
format?: ImageFormat;
519538
}
520539
export interface ImageProperties {
521540
alias: number;
@@ -531,6 +550,7 @@ declare module "jspdf" {
531550
predictor?: number;
532551
index: number;
533552
data: string;
553+
fileType: ImageFormat;
534554
}
535555

536556
export interface TextOptionsLight {
@@ -1077,7 +1097,7 @@ declare module "jspdf" {
10771097
): void;
10781098

10791099
// jsPDF plugin: html
1080-
html(src: string | HTMLElement, options?: HTMLOptions): Promise<HTMLWorker>;
1100+
html(src: string | HTMLElement, options?: HTMLOptions): HTMLWorker;
10811101

10821102
// jsPDF plugin: JavaScript
10831103
addJS(javascript: string): jsPDF;

0 commit comments

Comments
 (0)