31 lines
551 B
TypeScript
31 lines
551 B
TypeScript
|
declare module '@gm5/core' {
|
||
|
import { Server } from 'http'
|
||
|
|
||
|
interface Middleware {
|
||
|
(req: Request, res: Response, next: () => void): void
|
||
|
}
|
||
|
|
||
|
interface Installable {
|
||
|
name: string
|
||
|
install: (args: any) => any
|
||
|
}
|
||
|
|
||
|
class Five {
|
||
|
get server(): Server
|
||
|
|
||
|
set(obj: Config): this
|
||
|
|
||
|
get(key: string): any
|
||
|
|
||
|
use(fn: Middleware): this
|
||
|
|
||
|
install(module: Installable, args: any): this
|
||
|
|
||
|
preload(dir: string): this
|
||
|
|
||
|
listen(port?: number, callback?: () => void): this
|
||
|
}
|
||
|
|
||
|
export function createApp(conf?: object): Five
|
||
|
}
|