Skip to content

Commit 997e321

Browse files
committed
Add API docs to ChangeStream.close event
1 parent 42367dd commit 997e321

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/change_stream.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ import type { Readable } from 'stream';
33
import type { Binary, Document, Timestamp } from './bson';
44
import { Collection } from './collection';
55
import { CHANGE, CLOSE, END, ERROR, INIT, MORE, RESPONSE, RESUME_TOKEN_CHANGED } from './constants';
6-
import {
7-
type AbstractCursorEvents,
8-
type CursorStreamOptions,
9-
CursorTimeoutContext
10-
} from './cursor/abstract_cursor';
6+
import { type CursorStreamOptions, CursorTimeoutContext } from './cursor/abstract_cursor';
117
import { ChangeStreamCursor, type ChangeStreamCursorOptions } from './cursor/change_stream_cursor';
128
import { Db } from './db';
139
import {
@@ -544,7 +540,13 @@ export type ChangeStreamEvents<
544540
end(): void;
545541
error(error: Error): void;
546542
change(change: TChange): void;
547-
} & AbstractCursorEvents;
543+
/**
544+
* @remarks Note that the `close` event is currently emitted whenever the internal `ChangeStreamCursor`
545+
* instance is closed, which can occur multiple times for a given `ChangeStream` instance.
546+
* When this event is emitted is subject to change outside of major versions.
547+
*/
548+
close(): void;
549+
};
548550

549551
/**
550552
* Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}.

0 commit comments

Comments
 (0)