@@ -17,10 +17,6 @@ export interface MongoCryptStatus {
1717 message ?: string ;
1818}
1919
20- interface MongoCryptContextCtor {
21- new ( ...args : unknown [ ] ) : MongoCryptContext ;
22- }
23-
2420export interface MongoCryptContext {
2521 nextMongoOperation ( ) : Buffer ;
2622 addMongoOperationResponse ( response : Uint8Array ) : void ;
@@ -35,7 +31,16 @@ export interface MongoCryptContext {
3531}
3632
3733export interface MongoCryptConstructor {
38- new ( options : Record < string , unknown > ) : MongoCrypt ;
34+ new ( options : {
35+ kmsProviders ?: Buffer ;
36+ schemaMap ?: Buffer ;
37+ encryptedFieldsMap ?: Buffer ;
38+ logger ?: unknown ;
39+ cryptoCallbacks ?: Record < string , unknown > ;
40+ cryptSharedLibSearchPaths ?: string [ ] ;
41+ cryptSharedLibPath ?: string ;
42+ bypassQueryAnalysis ?: boolean ;
43+ } ) : MongoCrypt ;
3944 libmongocryptVersion : string ;
4045}
4146
@@ -80,10 +85,13 @@ export interface MongoCrypt {
8085export type ExplicitEncryptionContextOptions = NonNullable <
8186 Parameters < MongoCrypt [ 'makeExplicitEncryptionContext' ] > [ 1 ]
8287> ;
83-
8488export type DataKeyContextOptions = NonNullable < Parameters < MongoCrypt [ 'makeDataKeyContext' ] > [ 1 ] > ;
89+ export type MongoCryptOptions = NonNullable < ConstructorParameters < MongoCryptConstructor > [ 0 ] > ;
8590
8691export const MongoCrypt : MongoCryptConstructor = mc . MongoCrypt ;
8792
8893/** exported for testing only. */
94+ interface MongoCryptContextCtor {
95+ new ( ) : MongoCryptContext ;
96+ }
8997export const MongoCryptContextCtor : MongoCryptContextCtor = mc . MongoCryptContextCtor ;
0 commit comments