Skip to content

Commit 4540c7f

Browse files
Merge pull request #595 from karlhorky/patch-3
Allow for autocomplete on string literals
2 parents 4b1270c + fa93182 commit 4540c7f

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

types/index.d.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ declare module 'cloudinary' {
66
/****************************** Constants *************************************/
77
/****************************** Transformations *******************************/
88
type CropMode =
9-
string
9+
| (string & {})
1010
| "scale"
1111
| "fit"
1212
| "limit"
@@ -21,7 +21,7 @@ declare module 'cloudinary' {
2121
| "imagga_crop"
2222
| "imagga_scale";
2323
type Gravity =
24-
string
24+
| (string & {})
2525
| "north_west"
2626
| "north"
2727
| "north_east"
@@ -59,9 +59,9 @@ declare module 'cloudinary' {
5959
| "auto:none"
6060
| "liquid"
6161
| "ocr_text";
62-
type Angle = number | string | Array<number | string> | "auto_right" | "auto_left" | "ignore" | "vflip" | "hflip";
62+
type Angle = number | (string & {}) | Array<number | string> | "auto_right" | "auto_left" | "ignore" | "vflip" | "hflip";
6363
type ImageEffect =
64-
string
64+
| (string & {})
6565
| "hue"
6666
| "red"
6767
| "green"
@@ -112,11 +112,11 @@ declare module 'cloudinary' {
112112
| "gamma"
113113
| "improve";
114114

115-
type VideoEffect = string | "accelerate" | "reverse" | "boomerang" | "loop" | "make_transparent" | "transition";
116-
type AudioCodec = string | "none" | "aac" | "vorbis" | "mp3";
115+
type VideoEffect = (string & {}) | "accelerate" | "reverse" | "boomerang" | "loop" | "make_transparent" | "transition";
116+
type AudioCodec = (string & {}) | "none" | "aac" | "vorbis" | "mp3";
117117
type AudioFrequency =
118118
string
119-
| number
119+
| (number & {})
120120
| 8000
121121
| 11025
122122
| 16000
@@ -133,7 +133,7 @@ declare module 'cloudinary' {
133133
| 192000;
134134
/****************************** Flags *************************************/
135135
type ImageFlags =
136-
string
136+
| (string & {})
137137
| Array<string>
138138
| "any_format"
139139
| "attachment"
@@ -166,7 +166,7 @@ declare module 'cloudinary' {
166166
| "tiff8_lzw"
167167
| "tiled";
168168
type VideoFlags =
169-
string
169+
| (string & {})
170170
| Array<string>
171171
| "animated"
172172
| "awebp"
@@ -181,9 +181,9 @@ declare module 'cloudinary' {
181181
| "relative"
182182
| "truncate_ts"
183183
| "waveform";
184-
type ColorSpace = string | "srgb" | "no_cmyk" | "keep_cmyk";
184+
type ColorSpace = (string & {}) | "srgb" | "no_cmyk" | "keep_cmyk";
185185
type DeliveryType =
186-
string
186+
| (string & {})
187187
| "upload"
188188
| "private"
189189
| "authenticated"
@@ -204,9 +204,9 @@ declare module 'cloudinary' {
204204
| "worldstarhiphop"
205205
| "dailymotion";
206206
/****************************** URL *************************************/
207-
type ResourceType = string | "image" | "raw" | "video";
207+
type ResourceType = (string & {}) | "image" | "raw" | "video";
208208
type ImageFormat =
209-
string
209+
| (string & {})
210210
| "gif"
211211
| "png"
212212
| "jpg"
@@ -232,7 +232,7 @@ declare module 'cloudinary' {
232232
| "tga"
233233
| "heic"
234234
type VideoFormat =
235-
string
235+
| (string & {})
236236
| "auto"
237237
| "flv"
238238
| "m3u8"
@@ -261,7 +261,7 @@ declare module 'cloudinary' {
261261
angle?: Angle;
262262
radius?: number | string;
263263
overlay?: string | object; //might be Record<any, any>
264-
custom_function?: string | { function_type: string | "wasm" | "remote", source: string }
264+
custom_function?: string | { function_type: (string & {}) | "wasm" | "remote", source: string }
265265
variables?: Array<string | object>; //might be Record<any, any>
266266
if?: string;
267267
else?: string;
@@ -564,11 +564,11 @@ declare module 'cloudinary' {
564564
type AdminAndUpdateApiOptions = AdminApiOptions | UpdateApiOptions;
565565

566566
/****************************** API *************************************/
567-
type Status = string | "pending" | "approved" | "rejected";
568-
type StreamingProfiles = string | "4k" | "full_hd" | "hd" | "sd" | "full_hd_wifi" | "full_hd_lean" | "hd_lean";
569-
type ModerationKind = string | "manual" | "webpurify" | "aws_rek" | "metascan";
570-
type AccessMode = string | "public" | "authenticated";
571-
type TargetArchiveFormat = string | "zip" | "tgz";
567+
type Status = (string & {}) | "pending" | "approved" | "rejected";
568+
type StreamingProfiles = (string & {}) | "4k" | "full_hd" | "hd" | "sd" | "full_hd_wifi" | "full_hd_lean" | "hd_lean";
569+
type ModerationKind = (string & {}) | "manual" | "webpurify" | "aws_rek" | "metascan";
570+
type AccessMode = (string & {}) | "public" | "authenticated";
571+
type TargetArchiveFormat = (string & {}) | "zip" | "tgz";
572572

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

0 commit comments

Comments
 (0)