@firebase/firestore 4.6.4-canary.1b9d95e5a → 4.6.4-canary.46da0930c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,6 +103,10 @@ export declare abstract class PersistentStream<SendType, ReceiveType, ListenerTy
103
103
  private stream;
104
104
  protected backoff: ExponentialBackoff;
105
105
  constructor(queue: AsyncQueue, connectionTimerId: TimerId, idleTimerId: TimerId, healthTimerId: TimerId, connection: Connection, authCredentialsProvider: CredentialsProvider<User>, appCheckCredentialsProvider: CredentialsProvider<string>, listener: ListenerType);
106
+ /**
107
+ * Count of response messages received.
108
+ */
109
+ protected responseCount: number;
106
110
  /**
107
111
  * Returns true if start() has been called and no error has occurred. True
108
112
  * indicates the stream is open or in the process of opening (which
@@ -184,11 +188,17 @@ export declare abstract class PersistentStream<SendType, ReceiveType, ListenerTy
184
188
  */
185
189
  protected abstract startRpc(authToken: Token | null, appCheckToken: Token | null): Stream<SendType, ReceiveType>;
186
190
  /**
187
- * Called after the stream has received a message. The function will be
188
- * called on the right queue and must return a Promise.
191
+ * Called when the stream receives first message.
192
+ * The function will be called on the right queue and must return a Promise.
193
+ * @param message - The message received from the stream.
194
+ */
195
+ protected abstract onFirst(message: ReceiveType): Promise<void>;
196
+ /**
197
+ * Called on subsequent messages after the stream has received first message.
198
+ * The function will be called on the right queue and must return a Promise.
189
199
  * @param message - The message received from the stream.
190
200
  */
191
- protected abstract onMessage(message: ReceiveType): Promise<void>;
201
+ protected abstract onNext(message: ReceiveType): Promise<void>;
192
202
  private auth;
193
203
  private startStream;
194
204
  private performBackoff;
@@ -220,7 +230,8 @@ export declare class PersistentListenStream extends PersistentStream<ProtoListen
220
230
  private serializer;
221
231
  constructor(queue: AsyncQueue, connection: Connection, authCredentials: CredentialsProvider<User>, appCheckCredentials: CredentialsProvider<string>, serializer: JsonProtoSerializer, listener: WatchStreamListener);
222
232
  protected startRpc(authToken: Token | null, appCheckToken: Token | null): Stream<ProtoListenRequest, ProtoListenResponse>;
223
- protected onMessage(watchChangeProto: ProtoListenResponse): Promise<void>;
233
+ protected onFirst(watchChangeProto: ProtoListenResponse): Promise<void>;
234
+ protected onNext(watchChangeProto: ProtoListenResponse): Promise<void>;
224
235
  /**
225
236
  * Registers interest in the results of the given target. If the target
226
237
  * includes a resumeToken it will be included in the request. Results that
@@ -266,7 +277,6 @@ export interface WriteStreamListener extends PersistentStreamListener {
266
277
  */
267
278
  export declare class PersistentWriteStream extends PersistentStream<ProtoWriteRequest, ProtoWriteResponse, WriteStreamListener> {
268
279
  private serializer;
269
- private handshakeComplete_;
270
280
  constructor(queue: AsyncQueue, connection: Connection, authCredentials: CredentialsProvider<User>, appCheckCredentials: CredentialsProvider<string>, serializer: JsonProtoSerializer, listener: WriteStreamListener);
271
281
  /**
272
282
  * The last received stream token from the server, used to acknowledge which
@@ -285,7 +295,8 @@ export declare class PersistentWriteStream extends PersistentStream<ProtoWriteRe
285
295
  start(): void;
286
296
  protected tearDown(): void;
287
297
  protected startRpc(authToken: Token | null, appCheckToken: Token | null): Stream<ProtoWriteRequest, ProtoWriteResponse>;
288
- protected onMessage(responseProto: ProtoWriteResponse): Promise<void>;
298
+ protected onFirst(responseProto: ProtoWriteResponse): Promise<void>;
299
+ protected onNext(responseProto: ProtoWriteResponse): Promise<void>;
289
300
  /**
290
301
  * Sends an initial streamToken to the server, performing the handshake
291
302
  * required to make the StreamingWrite RPC work. Subsequent