@@ -7617,6 +7617,19 @@ declare namespace firebase.storage {
7617
7617
md5Hash ?: string | null ;
7618
7618
}
7619
7619
7620
+ /**
7621
+ * An error returned by the Firebase Storage SDK.
7622
+ */
7623
+ interface FirebaseStorageError extends FirebaseError {
7624
+ serverResponse : string | null ;
7625
+ }
7626
+
7627
+ interface StorageObserver < T > {
7628
+ next ?: NextFn < T > | null ;
7629
+ error ?: ( error : FirebaseStorageError ) => void | null ;
7630
+ complete ?: CompleteFn | null ;
7631
+ }
7632
+
7620
7633
/**
7621
7634
* Represents the process of uploading an object. Allows you to monitor and
7622
7635
* manage the upload.
@@ -7630,7 +7643,7 @@ declare namespace firebase.storage {
7630
7643
/**
7631
7644
* Equivalent to calling `then(null, onRejected)`.
7632
7645
*/
7633
- catch ( onRejected : ( a : Error ) => any ) : Promise < any > ;
7646
+ catch ( onRejected : ( error : FirebaseStorageError ) => any ) : Promise < any > ;
7634
7647
/**
7635
7648
* Listens for events on this task.
7636
7649
*
@@ -7730,7 +7743,7 @@ declare namespace firebase.storage {
7730
7743
* The `next` function, which gets called for each item in
7731
7744
* the event stream, or an observer object with some or all of these three
7732
7745
* properties (`next`, `error`, `complete`).
7733
- * @param error A function that gets called with an Error
7746
+ * @param error A function that gets called with a `FirebaseStorageError`
7734
7747
* if the event stream ends due to an error.
7735
7748
* @param complete A function that gets called if the
7736
7749
* event stream ends normally.
@@ -7743,10 +7756,10 @@ declare namespace firebase.storage {
7743
7756
on (
7744
7757
event : firebase . storage . TaskEvent ,
7745
7758
nextOrObserver ?:
7746
- | Partial < firebase . Observer < UploadTaskSnapshot > >
7759
+ | StorageObserver < UploadTaskSnapshot >
7747
7760
| null
7748
- | ( ( a : UploadTaskSnapshot ) => any ) ,
7749
- error ?: ( ( a : Error ) => any ) | null ,
7761
+ | ( ( snapshot : UploadTaskSnapshot ) => any ) ,
7762
+ error ?: ( ( error : FirebaseStorageError ) => any ) | null ,
7750
7763
complete ?: firebase . Unsubscribe | null
7751
7764
) : Function ;
7752
7765
/**
@@ -7771,8 +7784,10 @@ declare namespace firebase.storage {
7771
7784
* @param onRejected The rejection callback.
7772
7785
*/
7773
7786
then (
7774
- onFulfilled ?: ( ( a : firebase . storage . UploadTaskSnapshot ) => any ) | null ,
7775
- onRejected ?: ( ( a : Error ) => any ) | null
7787
+ onFulfilled ?:
7788
+ | ( ( snapshot : firebase . storage . UploadTaskSnapshot ) => any )
7789
+ | null ,
7790
+ onRejected ?: ( ( error : FirebaseStorageError ) => any ) | null
7776
7791
) : Promise < any > ;
7777
7792
}
7778
7793
0 commit comments