File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -2188,17 +2188,18 @@ declare module 'react-native-firebase' {
2188
2188
/**
2189
2189
* An HttpsCallableResult wraps a single result from a function call.
2190
2190
*/
2191
- interface HttpsCallableResult {
2192
- readonly data : any ;
2191
+ interface HttpsCallableResult < R = any > {
2192
+ readonly data : R ;
2193
2193
}
2194
2194
2195
2195
/**
2196
2196
* An HttpsCallable is a reference to a "callable" http trigger in
2197
2197
* Google Cloud Functions.
2198
2198
*/
2199
- interface HttpsCallable {
2200
- ( data ?: any ) : Promise < HttpsCallableResult > ;
2201
- }
2199
+ type HttpsCallable < Params , Result > =
2200
+ Params extends void ?
2201
+ ( ) => Promise < HttpsCallableResult < Result > > :
2202
+ ( data : Params ) => Promise < HttpsCallableResult < Result > >
2202
2203
2203
2204
/**
2204
2205
* `FirebaseFunctions` represents a Functions app, and is the entry point for
@@ -2212,7 +2213,7 @@ declare module 'react-native-firebase' {
2212
2213
* @param name The name of the https callable function.
2213
2214
* @return The `HttpsCallable` instance.
2214
2215
*/
2215
- httpsCallable ( name : string ) : HttpsCallable ;
2216
+ httpsCallable < Params = any , Result = any > ( name : string ) : HttpsCallable < Params , Result > ;
2216
2217
2217
2218
/**
2218
2219
* Changes this instance to point to a Cloud Functions emulator running
You can’t perform that action at this time.
0 commit comments