Skip to content

Commit 4171e2a

Browse files
authored
Make types more strict
1 parent f24e2bb commit 4171e2a

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

types/index.d.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ declare module 'cloudinary' {
66
/****************************** Constants *************************************/
77
/****************************** Transformations *******************************/
88
type CropMode =
9-
string
109
| "scale"
1110
| "fit"
1211
| "limit"
@@ -21,7 +20,6 @@ declare module 'cloudinary' {
2120
| "imagga_crop"
2221
| "imagga_scale";
2322
type Gravity =
24-
string
2523
| "north_west"
2624
| "north"
2725
| "north_east"
@@ -61,7 +59,6 @@ declare module 'cloudinary' {
6159
| "ocr_text";
6260
type Angle = number | string | Array<number | string> | "auto_right" | "auto_left" | "ignore" | "vflip" | "hflip";
6361
type ImageEffect =
64-
string
6562
| "hue"
6663
| "red"
6764
| "green"
@@ -166,7 +163,6 @@ declare module 'cloudinary' {
166163
| "tiff8_lzw"
167164
| "tiled";
168165
type VideoFlags =
169-
string
170166
| Array<string>
171167
| "animated"
172168
| "awebp"
@@ -181,9 +177,8 @@ declare module 'cloudinary' {
181177
| "relative"
182178
| "truncate_ts"
183179
| "waveform";
184-
type ColorSpace = string | "srgb" | "no_cmyk" | "keep_cmyk";
180+
type ColorSpace = "srgb" | "no_cmyk" | "keep_cmyk";
185181
type DeliveryType =
186-
string
187182
| "upload"
188183
| "private"
189184
| "authenticated"
@@ -204,9 +199,8 @@ declare module 'cloudinary' {
204199
| "worldstarhiphop"
205200
| "dailymotion";
206201
/****************************** URL *************************************/
207-
type ResourceType = string | "image" | "raw" | "video";
202+
type ResourceType = "image" | "raw" | "video";
208203
type ImageFormat =
209-
string
210204
| "gif"
211205
| "png"
212206
| "jpg"
@@ -232,7 +226,6 @@ declare module 'cloudinary' {
232226
| "tga"
233227
| "heic"
234228
type VideoFormat =
235-
string
236229
| "auto"
237230
| "flv"
238231
| "m3u8"
@@ -548,7 +541,6 @@ declare module 'cloudinary' {
548541
| string[]
549542
| VideoTransformationOptions
550543
| ImageTransformationOptions
551-
| Object
552544
| Array<ImageTransformationOptions>
553545
| Array<VideoTransformationOptions>;
554546

@@ -561,11 +553,11 @@ declare module 'cloudinary' {
561553
type AdminAndUpdateApiOptions = AdminApiOptions | UpdateApiOptions;
562554

563555
/****************************** API *************************************/
564-
type Status = string | "pending" | "approved" | "rejected";
565-
type StreamingProfiles = string | "4k" | "full_hd" | "hd" | "sd" | "full_hd_wifi" | "full_hd_lean" | "hd_lean";
566-
type ModerationKind = string | "manual" | "webpurify" | "aws_rek" | "metascan";
567-
type AccessMode = string | "public" | "authenticated";
568-
type TargetArchiveFormat = string | "zip" | "tgz";
556+
type Status = "pending" | "approved" | "rejected";
557+
type StreamingProfiles = "4k" | "full_hd" | "hd" | "sd" | "full_hd_wifi" | "full_hd_lean" | "hd_lean";
558+
type ModerationKind = "manual" | "webpurify" | "aws_rek" | "metascan";
559+
type AccessMode = "public" | "authenticated";
560+
type TargetArchiveFormat = "zip" | "tgz";
569561

570562
// err is kept for backwards compatibility, it currently will always be undefined
571563
type ResponseCallback = (err?: any, callResult?: any) => any;

0 commit comments

Comments
 (0)