forked from mongodb-js/compass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
41 lines (38 loc) · 1.2 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import type { CollectionCollection } from 'mongodb-collection-model';
import type { DataService } from 'mongodb-data-service';
interface Database {
_id: string;
name: string;
status: string;
statusError: string | null;
collectionsStatus: string;
collectionsStatusError: string | null;
collection_count: number;
document_count: number;
storage_size: number;
data_size: number;
index_count: number;
index_size: number;
collectionsLength: number;
collections: CollectionCollection;
fetch(opts: { dataService: DataService; force?: boolean }): Promise<void>;
fetchCollections(opts: {
dataService: DataService;
fetchInfo?: boolean;
force?: boolean;
}): Promise<void>;
fetchCollectionsDetails(opts: {
dataService: DataService;
nameOnly?: boolean;
force?: boolean;
}): Promise<void>;
toJSON(opts?: { derived: boolean }): this;
}
interface DatabaseCollection extends Array<Database> {
fetch(opts: { dataService: DataService }): Promise<void>;
toJSON(opts?: { derived: boolean }): this;
at(index: number): Database | undefined;
get(id: string, key?: '_id' | 'name'): Database | undefined;
}
export default Database;
export { DatabaseCollection as Collection };