Skip to content

Commit 3e9101e

Browse files
add fixups
1 parent 64398ef commit 3e9101e

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

bindings/node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "6.0.0-alpha.0",
44
"description": "Official client encryption module for the MongoDB Node.js driver",
55
"main": "lib/index.js",
6-
"types": "src/index",
6+
"types": "lib/index.d.ts",
77
"files": [
88
"README.md",
99
"CHANGELOG.md",

bindings/node/src/index.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ export interface MongoCryptStatus {
1717
message?: string;
1818
}
1919

20-
interface MongoCryptContextCtor {
21-
new (...args: unknown[]): MongoCryptContext;
22-
}
23-
2420
export interface MongoCryptContext {
2521
nextMongoOperation(): Buffer;
2622
addMongoOperationResponse(response: Uint8Array): void;
@@ -35,7 +31,16 @@ export interface MongoCryptContext {
3531
}
3632

3733
export 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 {
8085
export type ExplicitEncryptionContextOptions = NonNullable<
8186
Parameters<MongoCrypt['makeExplicitEncryptionContext']>[1]
8287
>;
83-
8488
export type DataKeyContextOptions = NonNullable<Parameters<MongoCrypt['makeDataKeyContext']>[1]>;
89+
export type MongoCryptOptions = NonNullable<ConstructorParameters<MongoCryptConstructor>[0]>;
8590

8691
export const MongoCrypt: MongoCryptConstructor = mc.MongoCrypt;
8792

8893
/** exported for testing only. */
94+
interface MongoCryptContextCtor {
95+
new (): MongoCryptContext;
96+
}
8997
export const MongoCryptContextCtor: MongoCryptContextCtor = mc.MongoCryptContextCtor;

0 commit comments

Comments
 (0)