Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,15 @@ declare module "jspdf" {
): HTMLWorker;
progress: HTMLWorkerProgress;
error(msg: string): void;
save(filename: string): void;
save(filename: string): Promise<void>;
set(opt: HTMLOptions): HTMLWorker;
get(key: "string"): HTMLWorker;
get(key: "string", cbk: (value: string) => void): string;
doCallback(): Promise<void>;
outputImg(
type: "img" | "datauristring" | "dataurlstring" | "datauri" | "dataurl"
): Promise<string>;
outputPdf: jsPDF["output"];
}

export interface HTMLOptionImage {
Expand Down Expand Up @@ -502,6 +507,19 @@ declare module "jspdf" {
| "Separation"
| "DeviceN";

export type ImageFormat =
| "RGBA"
| "UNKNOWN"
| "PNG"
| "TIFF"
| "JPG"
| "JPEG"
| "JPEG2000"
| "GIF87a"
| "GIF89a"
| "WEBP"
| "BMP";

export interface ImageOptions {
imageData:
| string
Expand All @@ -516,6 +534,7 @@ declare module "jspdf" {
alias?: string;
compression?: ImageCompression;
rotation?: number;
format?: ImageFormat;
}
export interface ImageProperties {
alias: number;
Expand All @@ -531,6 +550,7 @@ declare module "jspdf" {
predictor?: number;
index: number;
data: string;
fileType: ImageFormat;
}

export interface TextOptionsLight {
Expand Down Expand Up @@ -1077,7 +1097,7 @@ declare module "jspdf" {
): void;

// jsPDF plugin: html
html(src: string | HTMLElement, options?: HTMLOptions): Promise<HTMLWorker>;
html(src: string | HTMLElement, options?: HTMLOptions): HTMLWorker;

// jsPDF plugin: JavaScript
addJS(javascript: string): jsPDF;
Expand Down