File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ import type { Db } from '../db';
77import type { ClientSession } from '../sessions' ;
88
99/** @public */
10- export type ListDatabasesResult = string [ ] | Document [ ] ;
10+ export interface ListDatabasesResult {
11+ databases : ( { name : string ; sizeOnDisk ?: number ; empty ?: boolean } & Document ) [ ] ;
12+ totalSize ?: number ;
13+ totalSizeMb ?: number ;
14+ ok : 1 | 0 ;
15+ }
1116
1217/** @public */
1318export interface ListDatabasesOptions extends CommandOperationOptions {
Original file line number Diff line number Diff line change 1+ import { expectType } from 'tsd' ;
2+ import { Document , MongoClient } from '../../src/index' ;
3+
4+ const client = new MongoClient ( '' ) ;
5+ const admin = client . db ( ) . admin ( ) ;
6+
7+ expectType < {
8+ databases : ( { name : string ; sizeOnDisk ?: number ; empty ?: boolean } & Document ) [ ] ;
9+ totalSize ?: number ;
10+ totalSizeMb ?: number ;
11+ ok : 1 | 0 ;
12+ } > ( await admin . listDatabases ( ) ) ;
You can’t perform that action at this time.
0 commit comments