Skip to content

Commit b70cc7c

Browse files
authored
types: move deprecated overloads to the bottom (#3461)
1 parent beb1893 commit b70cc7c

File tree

7 files changed

+114
-116
lines changed

7 files changed

+114
-116
lines changed

src/admin.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ export class Admin {
6060
* @param callback - An optional callback, a Promise will be returned if none is provided
6161
*/
6262
command(command: Document): Promise<Document>;
63+
command(command: Document, options: RunCommandOptions): Promise<Document>;
6364
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
6465
command(command: Document, callback: Callback<Document>): void;
65-
command(command: Document, options: RunCommandOptions): Promise<Document>;
6666
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
6767
command(command: Document, options: RunCommandOptions, callback: Callback<Document>): void;
6868
command(
@@ -87,9 +87,9 @@ export class Admin {
8787
* @param callback - An optional callback, a Promise will be returned if none is provided
8888
*/
8989
buildInfo(): Promise<Document>;
90+
buildInfo(options: CommandOperationOptions): Promise<Document>;
9091
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
9192
buildInfo(callback: Callback<Document>): void;
92-
buildInfo(options: CommandOperationOptions): Promise<Document>;
9393
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
9494
buildInfo(options: CommandOperationOptions, callback: Callback<Document>): void;
9595
buildInfo(
@@ -108,9 +108,9 @@ export class Admin {
108108
* @param callback - An optional callback, a Promise will be returned if none is provided
109109
*/
110110
serverInfo(): Promise<Document>;
111+
serverInfo(options: CommandOperationOptions): Promise<Document>;
111112
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
112113
serverInfo(callback: Callback<Document>): void;
113-
serverInfo(options: CommandOperationOptions): Promise<Document>;
114114
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
115115
serverInfo(options: CommandOperationOptions, callback: Callback<Document>): void;
116116
serverInfo(
@@ -129,9 +129,9 @@ export class Admin {
129129
* @param callback - An optional callback, a Promise will be returned if none is provided
130130
*/
131131
serverStatus(): Promise<Document>;
132+
serverStatus(options: CommandOperationOptions): Promise<Document>;
132133
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
133134
serverStatus(callback: Callback<Document>): void;
134-
serverStatus(options: CommandOperationOptions): Promise<Document>;
135135
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
136136
serverStatus(options: CommandOperationOptions, callback: Callback<Document>): void;
137137
serverStatus(
@@ -150,9 +150,9 @@ export class Admin {
150150
* @param callback - An optional callback, a Promise will be returned if none is provided
151151
*/
152152
ping(): Promise<Document>;
153+
ping(options: CommandOperationOptions): Promise<Document>;
153154
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
154155
ping(callback: Callback<Document>): void;
155-
ping(options: CommandOperationOptions): Promise<Document>;
156156
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
157157
ping(options: CommandOperationOptions, callback: Callback<Document>): void;
158158
ping(
@@ -173,15 +173,15 @@ export class Admin {
173173
* @param callback - An optional callback, a Promise will be returned if none is provided
174174
*/
175175
addUser(username: string): Promise<Document>;
176+
addUser(username: string, password: string): Promise<Document>;
177+
addUser(username: string, options: AddUserOptions): Promise<Document>;
178+
addUser(username: string, password: string, options: AddUserOptions): Promise<Document>;
176179
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
177180
addUser(username: string, callback: Callback<Document>): void;
178-
addUser(username: string, password: string): Promise<Document>;
179181
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
180182
addUser(username: string, password: string, callback: Callback<Document>): void;
181-
addUser(username: string, options: AddUserOptions): Promise<Document>;
182183
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
183184
addUser(username: string, options: AddUserOptions, callback: Callback<Document>): void;
184-
addUser(username: string, password: string, options: AddUserOptions): Promise<Document>;
185185
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
186186
addUser(
187187
username: string,
@@ -224,9 +224,9 @@ export class Admin {
224224
* @param callback - An optional callback, a Promise will be returned if none is provided
225225
*/
226226
removeUser(username: string): Promise<boolean>;
227+
removeUser(username: string, options: RemoveUserOptions): Promise<boolean>;
227228
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
228229
removeUser(username: string, callback: Callback<boolean>): void;
229-
removeUser(username: string, options: RemoveUserOptions): Promise<boolean>;
230230
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
231231
removeUser(username: string, options: RemoveUserOptions, callback: Callback<boolean>): void;
232232
removeUser(
@@ -252,9 +252,9 @@ export class Admin {
252252
* @param callback - An optional callback, a Promise will be returned if none is provided
253253
*/
254254
validateCollection(collectionName: string): Promise<Document>;
255+
validateCollection(collectionName: string, options: ValidateCollectionOptions): Promise<Document>;
255256
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
256257
validateCollection(collectionName: string, callback: Callback<Document>): void;
257-
validateCollection(collectionName: string, options: ValidateCollectionOptions): Promise<Document>;
258258
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
259259
validateCollection(
260260
collectionName: string,
@@ -283,9 +283,9 @@ export class Admin {
283283
* @param callback - An optional callback, a Promise will be returned if none is provided
284284
*/
285285
listDatabases(): Promise<ListDatabasesResult>;
286+
listDatabases(options: ListDatabasesOptions): Promise<ListDatabasesResult>;
286287
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
287288
listDatabases(callback: Callback<ListDatabasesResult>): void;
288-
listDatabases(options: ListDatabasesOptions): Promise<ListDatabasesResult>;
289289
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
290290
listDatabases(options: ListDatabasesOptions, callback: Callback<ListDatabasesResult>): void;
291291
listDatabases(
@@ -309,9 +309,9 @@ export class Admin {
309309
* @param callback - An optional callback, a Promise will be returned if none is provided
310310
*/
311311
replSetGetStatus(): Promise<Document>;
312+
replSetGetStatus(options: CommandOperationOptions): Promise<Document>;
312313
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
313314
replSetGetStatus(callback: Callback<Document>): void;
314-
replSetGetStatus(options: CommandOperationOptions): Promise<Document>;
315315
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
316316
replSetGetStatus(options: CommandOperationOptions, callback: Callback<Document>): void;
317317
replSetGetStatus(

0 commit comments

Comments
 (0)