11export type CompleteCallback = ( err : Error | null , result : any , statusCode ?: number , headers ?: object ) => void ;
2+ export interface CompleteCallbackObject {
3+ statusCode ?: number | undefined ;
4+ body : any ;
5+ headers ?: object | undefined ;
6+ }
27
38export type ProgressCallback = ( bytesUploaded : number , bytesTotal : number ) => void ;
49export type ErrorCallback = ( err : string ) => void ;
@@ -49,6 +54,7 @@ export class Vimeo {
4954 * `host`, `port`, `query` or `headers`.
5055 * @param callback Called when complete, `function (err, json)`.
5156 */
57+ request ( url : string | RequestOptions ) : Promise < CompleteCallbackObject > ;
5258 request ( url : string | RequestOptions , callback : CompleteCallback ) : void ;
5359
5460 /**
@@ -66,6 +72,7 @@ export class Vimeo {
6672 * and configured in your API app settings.
6773 * @param fn Callback to execute on completion.
6874 */
75+ accessToken ( code : string , redirectUri : string ) : Promise < CompleteCallbackObject > ;
6976 accessToken ( code : string , redirectUri : string , fn : CompleteCallback ) : void ;
7077
7178 /**
@@ -96,6 +103,7 @@ export class Vimeo {
96103 * occured the first parameter will be that error, otherwise the first
97104 * parameter will be null.
98105 */
106+ generateClientCredentials ( scope : string | string [ ] ) : Promise < CompleteCallbackObject > ;
99107 generateClientCredentials ( scope : string | string [ ] , fn : CompleteCallback ) : void ;
100108
101109 /**
@@ -114,6 +122,7 @@ export class Vimeo {
114122 * @param progressCallback Callback to be executed when upload progress is updated.
115123 * @param errorCallback Callback to be executed when the upload returns an error.
116124 */
125+ upload ( file : string | File , params : object ) : Promise < string > ;
117126 upload (
118127 file : string | File ,
119128 params : object ,
@@ -142,6 +151,18 @@ export class Vimeo {
142151 * @param progressCallback Callback to be executed when upload progress is updated.
143152 * @param errorCallback Callback to be executed when the upload returns an error.
144153 */
154+ replace (
155+ file : string | File ,
156+ videoUri : string ,
157+ params : object ,
158+ ) : Promise < string > ;
159+ replace (
160+ file : string | File ,
161+ videoUri : string ,
162+ completeCallback : UriCallback ,
163+ progressCallback : ProgressCallback | undefined ,
164+ errorCallback : ErrorCallback ,
165+ ) : void ;
145166 replace (
146167 file : string | File ,
147168 videoUri : string ,
0 commit comments