(name: string, options?: HttpsCallableOptions)
| 165 | } |
| 166 | |
| 167 | httpsCallable(name: string, options?: HttpsCallableOptions): HttpsCallable { |
| 168 | const callable = this.native.HTTPSCallableWithName(name); |
| 169 | if (typeof options?.timeout === 'number') { |
| 170 | callable.timeoutInterval = options.timeout; |
| 171 | } |
| 172 | return (data: any) => { |
| 173 | return new Promise((resolve, reject) => { |
| 174 | if (data) { |
| 175 | callable.callWithObjectCompletion(serialize(data), (result, error) => { |
| 176 | if (error) { |
| 177 | reject(toHttpsError(error)); |
| 178 | } else { |
| 179 | resolve(deserialize(result.data)); |
| 180 | } |
| 181 | }); |
| 182 | } else { |
| 183 | callable.callWithCompletion((result, error) => { |
| 184 | if (error) { |
| 185 | reject(toHttpsError(error)); |
| 186 | } else { |
| 187 | resolve(deserialize(result.data)); |
| 188 | } |
| 189 | }); |
| 190 | } |
| 191 | }); |
| 192 | }; |
| 193 | } |
| 194 | |
| 195 | useEmulator(host: string, port: number) { |
| 196 | this.native.useEmulatorWithHostPort(host, port); |
nothing calls this directly
no test coverage detected