-
Notifications
You must be signed in to change notification settings - Fork 0
/
routerBase.d.ts
35 lines (29 loc) · 854 Bytes
/
routerBase.d.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
import { RequestHandler } from "express"
import { WebsocketRequestHandler } from "express-ws"
declare module RouterBase {
interface BaseRoute {
file: string
lastModified: Date
path?: string
class?: any
include: boolean
events: string[]
methods: string[]
notFound: boolean
methodNotAllowed: boolean
serverError: boolean
}
interface WebsocketRoute {
webSocket: true
middleware: WebsocketRequestHandler[]
}
interface WebRoute {
webSocket: false
middleware: RequestHandler<{[key: string]: string}, any, any, qs.ParsedQs, Record<string, any>>[]
}
export type Route = (BaseRoute & WebsocketRoute) | (BaseRoute & WebRoute)
}
declare class RouterBase {
static get route(): RouterBase.Route
}
export = RouterBase