@@ -189,7 +189,7 @@ type Fullsec = Subscripts & PlayerFullsec & {
189
189
190
190
/** @returns A random element from `array`, selected with a random number generated using `rng`
191
191
* (defaults to `Math.random`). */
192
- sample : ( array : any [ ] , rng ?: ( ) => number ) => any
192
+ sample : < T > ( array : T [ ] , rng ?: ( ) => number ) => T
193
193
194
194
/** @returns Whether two MongoDB `ObjectId`s are equivalent. */ are_ids_eq : ( id1 : any , id2 : any ) => boolean
195
195
/** Convert a MongoDB `ObjectId` to a string. */ id_to_str : ( id : string | { $oid : string } ) => any
@@ -270,7 +270,7 @@ type Fullsec = Subscripts & PlayerFullsec & {
270
270
map : < T , U > ( array : T [ ] , callback : ( index : number , value : T ) => U ) => U [ ]
271
271
272
272
/** @returns A new object derived from `obj` with only the keys specified in `keys`. */
273
- pick : ( obj : object , keys : string [ ] ) => any
273
+ pick : < TObj extends object , TKeys extends keyof TObj > ( obj : TObj , keys : TKeys [ ] ) => { [ K in TKeys ] : TObj [ K ] }
274
274
275
275
/** @returns An array with the elements from `array` in a random order. */ shuffle : < T > ( array : T [ ] ) => T [ ]
276
276
@@ -298,7 +298,7 @@ type Fullsec = Subscripts & PlayerFullsec & {
298
298
security_level_names : [ "NULLSEC" , "LOWSEC" , "MIDSEC" , "HIGHSEC" , "FULLSEC" ]
299
299
300
300
/** @returns The string name of a numeric security level. */
301
- get_security_level_name : ( security_level : number ) => any
301
+ get_security_level_name : ( security_level : number ) => string
302
302
303
303
/** @param result The return value of a call to `$db.i()` or `$db.r()`.
304
304
* @param nModified The expected value of `result.nModified`.
0 commit comments