Skip to content

Commit

Permalink
fix: internal access modifier on symbol properties (#2664)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Dec 7, 2020
1 parent 34f2cf4 commit f6d9b81
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 10 deletions.
9 changes: 8 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,12 @@
"promise/no-native": "error",

"@typescript-eslint/no-explicit-any": "off"
}
},
"overrides": [{
"files": ["*.d.ts"],
"rules": {
"prettier/prettier": "off",
"@typescript-eslint/no-empty-interface": "off"
}
}]
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@
"build:docs": "npm run build:dts && typedoc",
"check:bench": "node test/benchmarks/driverBench",
"check:coverage": "nyc npm run check:test",
"check:lint": "npm run build:dts && npm run check:eslint",
"check:lint": "npm run build:dts && npm run check:dts && npm run check:eslint",
"check:eslint": "eslint -v && eslint --max-warnings=0 --ext '.js,.ts' src test",
"check:dts": "tsc --noEmit mongodb.d.ts",
"check:test": "mocha --recursive test/functional test/unit",
"check:ts": "tsc -v && tsc --noEmit",
"check:atlas": "mocha --config \"test/manual/mocharc.json\" test/manual/atlas_connectivity.test.js",
Expand Down
3 changes: 3 additions & 0 deletions src/change_stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,11 @@ export class ChangeStream extends EventEmitter {
/** @internal */
cursor?: ChangeStreamCursor;
streamOptions?: CursorStreamOptions;
/** @internal */
[kResumeQueue]: Denque;
/** @internal */
[kCursorStream]?: Readable;
/** @internal */
[kClosed]: boolean;

/** @event */
Expand Down
3 changes: 1 addition & 2 deletions src/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ import type { CountOptions } from './operations/count';
import type { BulkWriteResult, BulkWriteOptions, AnyBulkWriteOperation } from './bulk/common';
import type { PkFactory } from './mongo_client';
import type { Logger, LoggerOptions } from './logger';
import type { OperationParent } from './operations/command';
import type { Sort } from './sort';
import { FindCursor } from './cursor/find_cursor';

Expand Down Expand Up @@ -161,7 +160,7 @@ export interface CollectionPrivate {
* });
* ```
*/
export class Collection implements OperationParent {
export class Collection {
/** @internal */
s: CollectionPrivate;

Expand Down
3 changes: 3 additions & 0 deletions src/cursor/aggregation_cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ const kOptions = Symbol('options');
* @public
*/
export class AggregationCursor extends AbstractCursor {
/** @internal */
[kParent]: OperationParent; // TODO: NODE-2883
/** @internal */
[kPipeline]: Document[];
/** @internal */
[kOptions]: AggregateOptions;

/** @internal */
Expand Down
4 changes: 3 additions & 1 deletion src/cursor/find_cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { formatSort, Sort, SortDirection } from '../sort';
import type { Callback, MongoDBNamespace } from '../utils';
import { AbstractCursor, assertUninitialized } from './abstract_cursor';

/** @internal */
const kFilter = Symbol('filter');
const kNumReturned = Symbol('numReturned');
const kBuiltOptions = Symbol('builtOptions');
Expand All @@ -29,8 +28,11 @@ export const FLAGS = [

/** @public */
export class FindCursor extends AbstractCursor {
/** @internal */
[kFilter]: Document;
/** @internal */
[kNumReturned]?: number;
/** @internal */
[kBuiltOptions]: FindOptions;

constructor(
Expand Down
3 changes: 1 addition & 2 deletions src/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import { executeOperation } from './operations/execute_operation';
import { EvalOperation, EvalOptions } from './operations/eval';
import type { IndexInformationOptions } from './operations/common_functions';
import type { MongoClient, PkFactory } from './mongo_client';
import type { OperationParent } from './operations/command';
import type { Admin } from './admin';

// Allowed parameters
Expand Down Expand Up @@ -135,7 +134,7 @@ export interface DbOptions extends BSONSerializeOptions, WriteConcernOptions, Lo
* });
* ```
*/
export class Db implements OperationParent {
export class Db {
/** @internal */
s: DbPrivate;

Expand Down
3 changes: 1 addition & 2 deletions src/mongo_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import type { CompressorName } from './cmap/wire_protocol/compression';
import type { AuthMechanism } from './cmap/auth/defaultAuthProviders';
import type { Topology } from './sdam/topology';
import type { ClientSession, ClientSessionOptions } from './sessions';
import type { OperationParent } from './operations/command';
import type { TagSet } from './sdam/server_description';
import type { ConnectionOptions as TLSConnectionOptions } from 'tls';
import type { TcpSocketConnectOpts as ConnectionOptions } from 'net';
Expand Down Expand Up @@ -247,7 +246,7 @@ export interface MongoClientPrivate {
* });
* ```
*/
export class MongoClient extends EventEmitter implements OperationParent {
export class MongoClient extends EventEmitter {
/** @internal */
s: MongoClientPrivate;
topology?: Topology;
Expand Down
2 changes: 1 addition & 1 deletion src/operations/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface CommandOperationOptions
noResponse?: boolean;
}

/** @public */
/** @internal */
export interface OperationParent {
s: { namespace: MongoDBNamespace };
readConcern?: ReadConcern;
Expand Down

0 comments on commit f6d9b81

Please sign in to comment.