Skip to content

Commit

Permalink
Fixes to types (#3302)
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtGokhan authored Oct 28, 2021
1 parent f5a19b0 commit 65f4027
Showing 1 changed file with 22 additions and 2 deletions.
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

0 comments on commit 65f4027

Please sign in to comment.