Skip to content

Commit

Permalink
replace exported enum types by string unions (#3021)
Browse files Browse the repository at this point in the history
  • Loading branch information
HackbrettXXX committed Dec 7, 2020
1 parent 1f23740 commit a2a4474
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
32 changes: 13 additions & 19 deletions types/index.d.ts
Expand Up @@ -445,25 +445,19 @@ declare module "jspdf" {
translate(x: number, y: number): void;
}

export enum ImageCompression {
NONE = "NONE",
FAST = "FAST",
MEDIUM = "MEDIUM",
SLOW = "SLOW"
}
export enum ColorSpace {
DEVICE_RGB = "DeviceRGB",
DEVICE_GRAY = "DeviceGray",
DEVICE_CMYK = "DeviceCMYK",
CAL_GRAY = "CalGray",
CAL_RGB = "CalRGB",
LAB = "Lab",
ICC_BASED = "ICCBased",
INDEXED = "Indexed",
PATTERN = "Pattern",
SEPARATION = "Separation",
DEVICE_N = "DeviceN"
}
export type ImageCompression = "NONE" | "FAST" | "MEDIUM" | "SLOW";
export type ColorSpace =
| "DeviceRGB"
| "DeviceGray"
| "DeviceCMYK"
| "CalGray"
| "CalRGB"
| "Lab"
| "ICCBased"
| "Indexed"
| "Pattern"
| "Separation"
| "DeviceN";

export interface ImageOptions {
imageData: string | HTMLImageElement | HTMLCanvasElement | Uint8Array;
Expand Down
3 changes: 2 additions & 1 deletion types/jspdf-tests-node.ts
Expand Up @@ -586,7 +586,8 @@ function test_addImage() {
x: 0,
y: 0,
width: 100,
height: 100
height: 100,
compression: "FAST"
});
}

Expand Down
3 changes: 2 additions & 1 deletion types/jspdf-tests.ts
Expand Up @@ -585,7 +585,8 @@ function test_addImage() {
x: 0,
y: 0,
width: 100,
height: 100
height: 100,
compression: "FAST"
});
}

Expand Down

0 comments on commit a2a4474

Please sign in to comment.