@@ -1813,7 +1813,7 @@ declare namespace firebase.functions {
1813
1813
/**
1814
1814
* Changes this instance to point to a Cloud Functions emulator running
1815
1815
* locally. See https://firebase.google.com/docs/functions/local-emulator
1816
- *
1816
+ *
1817
1817
* @deprecated Prefer the useEmulator(host, port) method.
1818
1818
* @param origin The origin of the local emulator, such as
1819
1819
* "http://localhost:5005".
@@ -3132,10 +3132,10 @@ declare namespace firebase.auth {
3132
3132
*/
3133
3133
useDeviceLanguage ( ) : void ;
3134
3134
/**
3135
- * Modify this Auth instance to communicate with the Firebase Auth emulator. This must be
3135
+ * Modify this Auth instance to communicate with the Firebase Auth emulator. This must be
3136
3136
* called synchronously immediately following the first call to `firebase.auth()`. Do not use
3137
3137
* with production credentials as emulator traffic is not encrypted.
3138
- *
3138
+ *
3139
3139
* @param url The URL at which the emulator is running (eg, 'http://localhost:9099')
3140
3140
*/
3141
3141
useEmulator ( url : string ) : void ;
@@ -7617,6 +7617,22 @@ 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 {
7624
+ name : string ;
7625
+ code : string ;
7626
+ message : string ;
7627
+ serverResponse : null | string ;
7628
+ }
7629
+
7630
+ interface StorageObserver < T > {
7631
+ next ?: NextFn < T > | null ;
7632
+ error ?: ( error : FirebaseStorageError ) => void | null ;
7633
+ complete ?: CompleteFn | null ;
7634
+ }
7635
+
7620
7636
/**
7621
7637
* Represents the process of uploading an object. Allows you to monitor and
7622
7638
* manage the upload.
@@ -7630,7 +7646,7 @@ declare namespace firebase.storage {
7630
7646
/**
7631
7647
* Equivalent to calling `then(null, onRejected)`.
7632
7648
*/
7633
- catch ( onRejected : ( a : Error ) => any ) : Promise < any > ;
7649
+ catch ( onRejected : ( error : FirebaseStorageError ) => any ) : Promise < any > ;
7634
7650
/**
7635
7651
* Listens for events on this task.
7636
7652
*
@@ -7730,7 +7746,7 @@ declare namespace firebase.storage {
7730
7746
* The `next` function, which gets called for each item in
7731
7747
* the event stream, or an observer object with some or all of these three
7732
7748
* properties (`next`, `error`, `complete`).
7733
- * @param error A function that gets called with an Error
7749
+ * @param error A function that gets called with a `FirebaseStorageError`
7734
7750
* if the event stream ends due to an error.
7735
7751
* @param complete A function that gets called if the
7736
7752
* event stream ends normally.
@@ -7743,10 +7759,10 @@ declare namespace firebase.storage {
7743
7759
on (
7744
7760
event : firebase . storage . TaskEvent ,
7745
7761
nextOrObserver ?:
7746
- | Partial < firebase . Observer < UploadTaskSnapshot > >
7762
+ | StorageObserver < UploadTaskSnapshot >
7747
7763
| null
7748
- | ( ( a : UploadTaskSnapshot ) => any ) ,
7749
- error ?: ( ( a : Error ) => any ) | null ,
7764
+ | ( ( snapshot : UploadTaskSnapshot ) => any ) ,
7765
+ error ?: ( ( error : FirebaseStorageError ) => any ) | null ,
7750
7766
complete ?: firebase . Unsubscribe | null
7751
7767
) : Function ;
7752
7768
/**
@@ -7771,8 +7787,10 @@ declare namespace firebase.storage {
7771
7787
* @param onRejected The rejection callback.
7772
7788
*/
7773
7789
then (
7774
- onFulfilled ?: ( ( a : firebase . storage . UploadTaskSnapshot ) => any ) | null ,
7775
- onRejected ?: ( ( a : Error ) => any ) | null
7790
+ onFulfilled ?:
7791
+ | ( ( snapshot : firebase . storage . UploadTaskSnapshot ) => any )
7792
+ | null ,
7793
+ onRejected ?: ( ( error : FirebaseStorageError ) => any ) | null
7776
7794
) : Promise < any > ;
7777
7795
}
7778
7796
0 commit comments