Skip to content

Commit a2a4474

Browse files
authored
replace exported enum types by string unions (#3021)
1 parent 1f23740 commit a2a4474

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

types/index.d.ts

+13-19
Original file line numberDiff line numberDiff line change
@@ -445,25 +445,19 @@ declare module "jspdf" {
445445
translate(x: number, y: number): void;
446446
}
447447

448-
export enum ImageCompression {
449-
NONE = "NONE",
450-
FAST = "FAST",
451-
MEDIUM = "MEDIUM",
452-
SLOW = "SLOW"
453-
}
454-
export enum ColorSpace {
455-
DEVICE_RGB = "DeviceRGB",
456-
DEVICE_GRAY = "DeviceGray",
457-
DEVICE_CMYK = "DeviceCMYK",
458-
CAL_GRAY = "CalGray",
459-
CAL_RGB = "CalRGB",
460-
LAB = "Lab",
461-
ICC_BASED = "ICCBased",
462-
INDEXED = "Indexed",
463-
PATTERN = "Pattern",
464-
SEPARATION = "Separation",
465-
DEVICE_N = "DeviceN"
466-
}
448+
export type ImageCompression = "NONE" | "FAST" | "MEDIUM" | "SLOW";
449+
export type ColorSpace =
450+
| "DeviceRGB"
451+
| "DeviceGray"
452+
| "DeviceCMYK"
453+
| "CalGray"
454+
| "CalRGB"
455+
| "Lab"
456+
| "ICCBased"
457+
| "Indexed"
458+
| "Pattern"
459+
| "Separation"
460+
| "DeviceN";
467461

468462
export interface ImageOptions {
469463
imageData: string | HTMLImageElement | HTMLCanvasElement | Uint8Array;

types/jspdf-tests-node.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,8 @@ function test_addImage() {
586586
x: 0,
587587
y: 0,
588588
width: 100,
589-
height: 100
589+
height: 100,
590+
compression: "FAST"
590591
});
591592
}
592593

types/jspdf-tests.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,8 @@ function test_addImage() {
585585
x: 0,
586586
y: 0,
587587
width: 100,
588-
height: 100
588+
height: 100,
589+
compression: "FAST"
589590
});
590591
}
591592

0 commit comments

Comments
 (0)