-
Notifications
You must be signed in to change notification settings - Fork 404
/
Copy pathMiddlewareMetadata.ts
41 lines (34 loc) · 1.02 KB
/
MiddlewareMetadata.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { MiddlewareMetadataArgs } from './args/MiddlewareMetadataArgs';
/**
* Middleware metadata.
*/
export class MiddlewareMetadata {
// -------------------------------------------------------------------------
// Properties
// -------------------------------------------------------------------------
/**
* Indicates if this middleware is global, thous applied to all routes.
*/
global: boolean;
/**
* Object class of the middleware class.
*/
target: Function;
/**
* Execution priority of the middleware.
*/
priority: number;
/**
* Indicates if middleware must be executed after routing action is executed.
*/
type: 'before' | 'after';
// -------------------------------------------------------------------------
// Constructor
// -------------------------------------------------------------------------
constructor(args: MiddlewareMetadataArgs) {
this.global = args.global;
this.target = args.target;
this.priority = args.priority;
this.type = args.type;
}
}