1+ import * as BSON from 'bson' ;
2+
13declare module 'mongoose' {
24
35 /** The Mongoose Date [SchemaType](/docs/schematypes.html). */
@@ -207,6 +209,8 @@ declare module 'mongoose' {
207209 maxlength ?: number | [ number , string ] | readonly [ number , string ] ;
208210
209211 [ other : string ] : any ;
212+
213+ encrypt ?: EncryptSchemaTypeOptions ;
210214 }
211215
212216 interface Validator < DocType = any > {
@@ -218,6 +222,28 @@ declare module 'mongoose' {
218222
219223 type ValidatorFunction < DocType = any > = ( this : DocType , value : any , validatorProperties ?: Validator ) => any ;
220224
225+ export interface EncryptSchemaTypeOptions {
226+ /** The id of the dataKey to use for encryption */
227+ keyId : BSON . UUID ;
228+
229+ /**
230+ * Specifies the type of queries that the field can be queried on for Queryable Encryption.
231+ * Required when `SchemaOptions.encryptionType` is 'queryableEncryption'
232+ */
233+ queries ?: 'equality' | 'range' ;
234+
235+ /**
236+ * The algorithm to use for encryption.
237+ * Required when `SchemaOptions.encryptionType` is 'csfle'
238+ */
239+ algorithm ?:
240+ | 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'
241+ | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'
242+ | 'Indexed'
243+ | 'Unindexed'
244+ | 'Range' ;
245+ }
246+
221247 class SchemaType < T = any , DocType = any > {
222248 /** SchemaType constructor */
223249 constructor ( path : string , options ?: AnyObject , instance ?: string ) ;
0 commit comments