@@ -51,32 +51,32 @@ export default function constructShellBson(bson: typeof BSON, printWarning: (msg
51
51
( bson . BSONSymbol as any ) . prototype . deprecated = true ;
52
52
53
53
const bsonPkg = {
54
- DBRef : Object . assign ( function ( namespace : string , oid : any , db ?: string ) : any {
54
+ DBRef : Object . assign ( function ( namespace : string , oid : any , db ?: string ) : typeof bson . DBRef . prototype {
55
55
assertArgsDefinedType ( [ namespace , oid , db ] , [ 'string' , true , [ undefined , 'string' ] ] , 'DBRef' ) ;
56
56
return new bson . DBRef ( namespace , oid , db ) ;
57
57
} , { prototype : bson . DBRef . prototype } ) ,
58
58
// DBPointer not available in the bson 1.x library, but depreciated since 1.6
59
59
Map : bson . Map ,
60
- bsonsize : function ( object : any ) : any {
60
+ bsonsize : function ( object : any ) : number {
61
61
assertArgsDefinedType ( [ object ] , [ 'object' ] , 'bsonsize' ) ;
62
62
return bson . calculateObjectSize ( object ) ;
63
63
} ,
64
- MaxKey : Object . assign ( function ( ) : any {
64
+ MaxKey : Object . assign ( function ( ) : typeof bson . MaxKey . prototype {
65
65
return new bson . MaxKey ( ) ;
66
66
} , { prototype : bson . MaxKey . prototype } ) ,
67
- MinKey : Object . assign ( function ( ) : any {
67
+ MinKey : Object . assign ( function ( ) : typeof bson . MinKey . prototype {
68
68
return new bson . MinKey ( ) ;
69
69
} , { prototype : bson . MinKey . prototype } ) ,
70
- ObjectId : Object . assign ( function ( id ?: string ) : any {
71
- assertArgsDefinedType ( [ id ] , [ [ undefined , 'string' ] ] , 'ObjectId' ) ;
70
+ ObjectId : Object . assign ( function ( id ?: string | number | typeof bson . ObjectId . prototype | Buffer ) : typeof bson . ObjectId . prototype {
71
+ assertArgsDefinedType ( [ id ] , [ [ undefined , 'string' , 'number' , 'object' ] ] , 'ObjectId' ) ;
72
72
return new bson . ObjectId ( id ) ;
73
73
} , { prototype : bson . ObjectId . prototype } ) ,
74
- Timestamp : Object . assign ( function ( low = 0 , high = 0 ) : any {
75
- assertArgsDefinedType ( [ low , high ] , [ 'number' , 'number' ] , 'Timestamp' ) ;
76
- return new bson . Timestamp ( low , high ) ;
74
+ Timestamp : Object . assign ( function ( low ?: number | typeof bson . Long . prototype , high ?: number ) : typeof bson . Timestamp . prototype {
75
+ assertArgsDefinedType ( [ low , high ] , [ [ 'number' , 'object' , undefined ] , [ undefined , ' number'] ] , 'Timestamp' ) ;
76
+ return new bson . Timestamp ( low as number , high as number ) ;
77
77
} , { prototype : bson . Timestamp . prototype } ) ,
78
- Code : Object . assign ( function ( c : any = '' , s ?: any ) : any {
79
- assertArgsDefinedType ( [ c , s ] , [ [ undefined , 'string' ] , [ undefined , 'object' ] ] , 'Code' ) ;
78
+ Code : Object . assign ( function ( c : string | Function = '' , s ?: any ) : typeof bson . Code . prototype {
79
+ assertArgsDefinedType ( [ c , s ] , [ [ undefined , 'string' , 'function' ] , [ undefined , 'object' ] ] , 'Code' ) ;
80
80
return new bson . Code ( c , s ) ;
81
81
} , { prototype : bson . Code . prototype } ) ,
82
82
NumberDecimal : Object . assign ( function ( s = '0' ) : any {
0 commit comments