File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ // Interface.
2+ import { MiddlewareShape } from "../interface/middleware.shape" ;
3+ /**
4+ * @description
5+ * @export
6+ * @abstract
7+ * @class MiddlewareCore
8+ * @typedef {MiddlewareCore }
9+ * @template [Input=any]
10+ * @template [Output=void]
11+ * @template [Middleware=any]
12+ * @implements {MiddlewareShape<Input, Middleware>}
13+ */
14+ export abstract class MiddlewareCore <
15+ Input = any ,
16+ Output = void ,
17+ Middleware = any
18+ > implements MiddlewareShape < Input , Output , Middleware > {
19+ /**
20+ * @description
21+ * @public
22+ * @abstract
23+ * @param {...Input[] } args
24+ */
25+ public abstract execute ( context : Input ) : this;
26+ public abstract execute ( ...args : Input [ ] ) : this;
27+
28+ /**
29+ * @description
30+ * @public
31+ * @abstract
32+ * @param {Middleware } middleware
33+ * @returns {this }
34+ */
35+ public abstract use ( middleware : Middleware ) : this;
36+
37+ public abstract executeAsync ( context : Input ) : Promise < Output > ;
38+ public abstract executeAsync ( ...args : Input [ ] ) : Promise < Output > ;
39+ }
You can’t perform that action at this time.
0 commit comments