File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,9 +289,13 @@ Set a function to be called whenever **progress state changes**.
289289
290290Define a reference object to address the Dialog API wrapper.
291291
292+ [ Dialog API reference] [ api-refs-dialog ]
293+ <!-- TODO: * [Example][sandbox-ref] -->
294+
292295``` typescript
293296interface DialogApi {
294- addFiles(files : FileInfo []): void ;
297+ addFiles(type : string , files : any []): void ;
298+ addFiles(files : Array <JQuery .Deferred <FileInfo >>): void ;
295299 switchTab(tab : string ): void ;
296300 getFileColl(): CollectionOfPromises <FileInfo >;
297301 hideTab(tab : string ): void ;
@@ -301,9 +305,6 @@ interface DialogApi {
301305}
302306```
303307
304- * [ Dialog API reference] [ api-refs-dialog ]
305- <!-- TODO: * [Example][sandbox-ref] -->
306-
307308<br >
308309
309310#### Those methods works exactly the same way as in ` Widget ` component:
Original file line number Diff line number Diff line change @@ -299,6 +299,7 @@ interface CollectionOfPromises<T> extends UniqCollection<JQuery.Deferred<T>> {
299299}
300300
301301interface DialogApi {
302+ addFiles ( type : string , files : any [ ] ) : void ;
302303 addFiles ( files : Array < JQuery . Deferred < FileInfo > > ) : void ;
303304 switchTab ( tab : string ) : void ;
304305 getFileColl ( ) : CollectionOfPromises < FileInfo > ;
Original file line number Diff line number Diff line change @@ -134,14 +134,17 @@ const UnsplashCreator: CustomTabConstructor = (
134134 Random photo from unsplash:
135135 < br />
136136 < button
137- onClick = { ( ) =>
137+ onClick = { ( ) => {
138138 dialog . addFiles ( [
139139 uploadcare . fileFrom (
140140 "url" ,
141141 "https://source.unsplash.com/random/800x600/" ,
142142 settings
143143 )
144- ] )
144+ ] ) ;
145+
146+ dialog . addFiles ( 'object' , [ new Blob ( [ 'test' ] ) ] ) ;
147+ }
145148 }
146149 >
147150 { "Load ✨" }
You can’t perform that action at this time.
0 commit comments