Skip to content

Commit f6d9b81

Browse files
authored
fix: internal access modifier on symbol properties (#2664)
1 parent 34f2cf4 commit f6d9b81

File tree

9 files changed

+23
-10
lines changed

9 files changed

+23
-10
lines changed

.eslintrc.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,12 @@
3333
"promise/no-native": "error",
3434

3535
"@typescript-eslint/no-explicit-any": "off"
36-
}
36+
},
37+
"overrides": [{
38+
"files": ["*.d.ts"],
39+
"rules": {
40+
"prettier/prettier": "off",
41+
"@typescript-eslint/no-empty-interface": "off"
42+
}
43+
}]
3744
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@
9595
"build:docs": "npm run build:dts && typedoc",
9696
"check:bench": "node test/benchmarks/driverBench",
9797
"check:coverage": "nyc npm run check:test",
98-
"check:lint": "npm run build:dts && npm run check:eslint",
98+
"check:lint": "npm run build:dts && npm run check:dts && npm run check:eslint",
9999
"check:eslint": "eslint -v && eslint --max-warnings=0 --ext '.js,.ts' src test",
100+
"check:dts": "tsc --noEmit mongodb.d.ts",
100101
"check:test": "mocha --recursive test/functional test/unit",
101102
"check:ts": "tsc -v && tsc --noEmit",
102103
"check:atlas": "mocha --config \"test/manual/mocharc.json\" test/manual/atlas_connectivity.test.js",

src/change_stream.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,11 @@ export class ChangeStream extends EventEmitter {
183183
/** @internal */
184184
cursor?: ChangeStreamCursor;
185185
streamOptions?: CursorStreamOptions;
186+
/** @internal */
186187
[kResumeQueue]: Denque;
188+
/** @internal */
187189
[kCursorStream]?: Readable;
190+
/** @internal */
188191
[kClosed]: boolean;
189192

190193
/** @event */

src/collection.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ import type { CountOptions } from './operations/count';
8484
import type { BulkWriteResult, BulkWriteOptions, AnyBulkWriteOperation } from './bulk/common';
8585
import type { PkFactory } from './mongo_client';
8686
import type { Logger, LoggerOptions } from './logger';
87-
import type { OperationParent } from './operations/command';
8887
import type { Sort } from './sort';
8988
import { FindCursor } from './cursor/find_cursor';
9089

@@ -161,7 +160,7 @@ export interface CollectionPrivate {
161160
* });
162161
* ```
163162
*/
164-
export class Collection implements OperationParent {
163+
export class Collection {
165164
/** @internal */
166165
s: CollectionPrivate;
167166

src/cursor/aggregation_cursor.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ const kOptions = Symbol('options');
2525
* @public
2626
*/
2727
export class AggregationCursor extends AbstractCursor {
28+
/** @internal */
2829
[kParent]: OperationParent; // TODO: NODE-2883
30+
/** @internal */
2931
[kPipeline]: Document[];
32+
/** @internal */
3033
[kOptions]: AggregateOptions;
3134

3235
/** @internal */

src/cursor/find_cursor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { formatSort, Sort, SortDirection } from '../sort';
1212
import type { Callback, MongoDBNamespace } from '../utils';
1313
import { AbstractCursor, assertUninitialized } from './abstract_cursor';
1414

15-
/** @internal */
1615
const kFilter = Symbol('filter');
1716
const kNumReturned = Symbol('numReturned');
1817
const kBuiltOptions = Symbol('builtOptions');
@@ -29,8 +28,11 @@ export const FLAGS = [
2928

3029
/** @public */
3130
export class FindCursor extends AbstractCursor {
31+
/** @internal */
3232
[kFilter]: Document;
33+
/** @internal */
3334
[kNumReturned]?: number;
35+
/** @internal */
3436
[kBuiltOptions]: FindOptions;
3537

3638
constructor(

src/db.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import { executeOperation } from './operations/execute_operation';
5555
import { EvalOperation, EvalOptions } from './operations/eval';
5656
import type { IndexInformationOptions } from './operations/common_functions';
5757
import type { MongoClient, PkFactory } from './mongo_client';
58-
import type { OperationParent } from './operations/command';
5958
import type { Admin } from './admin';
6059

6160
// Allowed parameters
@@ -135,7 +134,7 @@ export interface DbOptions extends BSONSerializeOptions, WriteConcernOptions, Lo
135134
* });
136135
* ```
137136
*/
138-
export class Db implements OperationParent {
137+
export class Db {
139138
/** @internal */
140139
s: DbPrivate;
141140

src/mongo_client.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import type { CompressorName } from './cmap/wire_protocol/compression';
1616
import type { AuthMechanism } from './cmap/auth/defaultAuthProviders';
1717
import type { Topology } from './sdam/topology';
1818
import type { ClientSession, ClientSessionOptions } from './sessions';
19-
import type { OperationParent } from './operations/command';
2019
import type { TagSet } from './sdam/server_description';
2120
import type { ConnectionOptions as TLSConnectionOptions } from 'tls';
2221
import type { TcpSocketConnectOpts as ConnectionOptions } from 'net';
@@ -247,7 +246,7 @@ export interface MongoClientPrivate {
247246
* });
248247
* ```
249248
*/
250-
export class MongoClient extends EventEmitter implements OperationParent {
249+
export class MongoClient extends EventEmitter {
251250
/** @internal */
252251
s: MongoClientPrivate;
253252
topology?: Topology;

src/operations/command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface CommandOperationOptions
3737
noResponse?: boolean;
3838
}
3939

40-
/** @public */
40+
/** @internal */
4141
export interface OperationParent {
4242
s: { namespace: MongoDBNamespace };
4343
readConcern?: ReadConcern;

0 commit comments

Comments
 (0)