Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions types/cloudinary_ts_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as cloudinary from 'cloudinary';
import * as Http from "http";

// $ExpectType void
cloudinary.v2.config({
Expand Down Expand Up @@ -994,3 +995,23 @@ cloudinary.v2.provisioning.account.user_group_users(
(res) => {

});


// $ExpectType string
cloudinary.v2.utils.private_download_url('foo', 'foo', {
attachment: true,
expires_at: 111
});


// $ExpectType Promise<any>
cloudinary.v2.api.create_folder('foo',{
attachment: true,
expires_at: 111
});


// $ExpectType Promise<any>
cloudinary.v2.api.delete_folder('foo',{
agent: new Http.Agent()
});
18 changes: 11 additions & 7 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,7 @@ declare module 'cloudinary' {
| "make_transparent"
| "shadow"
| "viesus_correct"
| "contrast"
| "vibrance"
| "fill_light"
| "auto_color"
| "auto_contrast"
| "auto_brightness"
| "gamma"
| "improve";

Expand Down Expand Up @@ -148,7 +143,6 @@ declare module 'cloudinary' {
| "clip_evenodd"
| "cutter"
| "force_strip"
| "force_strip"
| "getinfo"
| "ignore_aspect_ratio"
| "immutable_cache"
Expand All @@ -158,7 +152,6 @@ declare module 'cloudinary' {
| "lossy"
| "preserve_transparency"
| "png8"
| "png8"
| "png32"
| "progressive"
| "rasterize"
Expand Down Expand Up @@ -730,6 +723,13 @@ declare module 'cloudinary' {
function generate_auth_token(options?: AuthTokenApiOptions): string;

function webhook_signature(data?: string, timestamp?: number, options?: ConfigOptions): string;

function private_download_url(publicID: string, format:string, options: Partial<{
resource_type: ResourceType;
type: DeliveryType;
expires_at: number;
attachment: boolean;
}>): string;
}

/****************************** Admin API V2 Methods *************************************/
Expand Down Expand Up @@ -905,6 +905,10 @@ declare module 'cloudinary' {

function usage(options?: AdminApiOptions): Promise<any>;

function create_folder(path:string, options?: AdminApiOptions, callback?: ResponseCallback): Promise<any>;

function delete_folder(path:string, options?: AdminApiOptions, callback?: ResponseCallback): Promise<any>;

/****************************** Structured Metadata API V2 Methods *************************************/

function add_metadata_field(field: MetadataFieldApiOptions, options?: AdminApiOptions, callback?: ResponseCallback): Promise<MetadataFieldApiResponse>;
Expand Down