@galeh/chuka 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +5 -4
- package/package.json +5 -2
- package/validators/index.d.ts +1 -2
package/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import core from 'express-serve-static-core';
|
|
2
1
|
import express from 'express';
|
|
3
2
|
import { interfaces } from 'inversify';
|
|
4
3
|
import ws from 'ws';
|
|
@@ -60,7 +59,7 @@ declare type MergePartial<A, B> = {
|
|
|
60
59
|
} & Omit<A, keyof B> & Partial<Omit<B, keyof A>>;
|
|
61
60
|
|
|
62
61
|
export declare interface Middleware<T> {
|
|
63
|
-
(req: MergePartial<express.Request, T>, res: express.Response, next:
|
|
62
|
+
(req: MergePartial<express.Request, T>, res: express.Response, next: express.NextFunction): void;
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
declare class MiniController<T> implements MiniControllerInterface<T> {
|
|
@@ -143,18 +142,20 @@ declare interface ParamsDictionary {
|
|
|
143
142
|
[key: string]: string;
|
|
144
143
|
}
|
|
145
144
|
|
|
145
|
+
declare type PathParams = string | RegExp | Array<string | RegExp>;
|
|
146
|
+
|
|
146
147
|
declare type RemoveTail<S extends string, Tail extends string> = S extends `${infer P}${Tail}` ? P : S;
|
|
147
148
|
|
|
148
149
|
declare interface RequestHandler<T, P = ParamsDictionary> {
|
|
149
150
|
(req: Merge<express.Request, T & {
|
|
150
151
|
params: P;
|
|
151
|
-
}>, res: express.Response, next:
|
|
152
|
+
}>, res: express.Response, next: express.NextFunction): void;
|
|
152
153
|
}
|
|
153
154
|
|
|
154
155
|
declare type RequestHandlerParams<T> = Middleware<T> | ErrorHandler<T>;
|
|
155
156
|
|
|
156
157
|
declare interface Route {
|
|
157
|
-
path:
|
|
158
|
+
path: PathParams;
|
|
158
159
|
controller: Type<Controller>;
|
|
159
160
|
children?: Array<Route>;
|
|
160
161
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galeh/chuka",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "simple yet robust wrapper for expressjs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chuka",
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"express-ws": "^5.0.2",
|
|
21
21
|
"inversify": "^6.0.2",
|
|
22
22
|
"reflect-metadata": "^0.2.1",
|
|
23
|
-
"tslib": "^2.6.2"
|
|
23
|
+
"tslib": "^2.6.2",
|
|
24
|
+
"@types/express": "^4.17.21",
|
|
25
|
+
"@types/express-ws": "^3.0.4",
|
|
26
|
+
"@types/ws": "^8.5.10"
|
|
24
27
|
}
|
|
25
28
|
}
|
package/validators/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import core from 'express-serve-static-core';
|
|
2
1
|
import express from 'express';
|
|
3
2
|
|
|
4
3
|
export declare function and<T>(...validationFunctions: Array<Validator<T>>): Validator<T>;
|
|
@@ -31,7 +30,7 @@ declare type MergePartial<A, B> = {
|
|
|
31
30
|
} & Omit<A, keyof B> & Partial<Omit<B, keyof A>>;
|
|
32
31
|
|
|
33
32
|
declare interface Middleware<T> {
|
|
34
|
-
(req: MergePartial<express.Request, T>, res: express.Response, next:
|
|
33
|
+
(req: MergePartial<express.Request, T>, res: express.Response, next: express.NextFunction): void;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
export declare function not<T>(validationFunction: Validator<T>): Validator<T>;
|