Skip to content

Commit da4841e

Browse files
patrick-tolosastrausr
authored andcommitted
Fix/fixed type def for upload stream
1 parent b72b69b commit da4841e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

types/cloudinary_ts_spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,3 +763,10 @@ cloudinary.v2.uploader.remove_tag('12', ['11']).then((value) => {
763763
cloudinary.v2.uploader.remove_tag('12', ['11'], function (err, res) {
764764
console.log(err, res);
765765
});
766+
767+
// $ExpectType Promise<any>
768+
cloudinary.v2.uploader.upload_stream(
769+
{template: "http://www.example.com/images/"},
770+
function (error, result) {
771+
console.log(result);
772+
});

types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,9 @@ declare module 'cloudinary' {
838838

839839
function upload_large(path: string, callback?: ErrorCallBack): Promise<any>;
840840

841-
function upload_stream(upload_preset: string, options?: UploadApiOptions, callback?: ErrorCallBack): Promise<any>;
842-
843-
function upload_stream(upload_preset: string, callback?: ErrorCallBack): Promise<any>;
841+
function upload_stream(options?: UploadApiOptions, callback?: ErrorCallBack): Promise<any>;
842+
843+
function upload_stream(callback?: ErrorCallBack): Promise<any>;
844844

845845
function upload_tag_params(options?: UploadApiOptions, callback?: ErrorCallBack): Promise<any>;
846846

0 commit comments

Comments
 (0)