File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 4
4
"description" : " Convert query parameters from API urls to MongoDB queries" ,
5
5
"main" : " dist/cjs/index.js" ,
6
6
"files" : [
7
- " dist/"
7
+ " dist/" ,
8
+ " ./types.d.ts"
8
9
],
10
+ "types" : " ./types.d.ts" ,
9
11
"scripts" : {
10
12
"build" : " babel ./src/index.js --out-file ./dist/cjs/index.js" ,
11
13
"coverage" : " nyc npm test && nyc report --reporter=html" ,
Original file line number Diff line number Diff line change
1
+ declare module 'api-query-params' {
2
+ export type AqpQuery = {
3
+ filter : Record < string , any > ;
4
+ skip : number ;
5
+ limit : number ;
6
+ sort : Record < string , number > ;
7
+ projection : Record < string , number > ;
8
+ } ;
9
+
10
+ function aqp (
11
+ query : string | Record < string , string > ,
12
+ opt ?: {
13
+ skipKey ?: string ;
14
+ limitKey ?: string ;
15
+ projectionKey ?: string ;
16
+ sortKey ?: string ;
17
+ filterKey ?: string ;
18
+ populationKey ?: string ;
19
+
20
+ blacklist ?: string [ ] ;
21
+ whitelist ?: string [ ] ;
22
+
23
+ castParams ?: unknown ;
24
+ casters ?: unknown ;
25
+ }
26
+ ) : AqpQuery ;
27
+
28
+ export default aqp ;
29
+ }
You can’t perform that action at this time.
0 commit comments