33 lines
725 B
TypeScript
33 lines
725 B
TypeScript
declare module '@gm5/core' {
|
|
import { Server } from 'http'
|
|
import Request from '@gm5/request'
|
|
import Response from '@gm5/response'
|
|
|
|
declare type Mountable = string[]
|
|
|
|
interface Middleware {
|
|
(req: Request, res: Response, next: () => void): void
|
|
}
|
|
|
|
interface Installable {
|
|
name: string
|
|
install: (args?: Record<string, any>) => any
|
|
}
|
|
|
|
export default class Five {
|
|
get server(): Server
|
|
|
|
set(obj: object): this
|
|
|
|
get(key: string): any
|
|
|
|
use(middleware: Middleware | Installable | Mountable, args?: Record<string, any>): this
|
|
|
|
listen(port?: number, callback?: () => void): this
|
|
}
|
|
|
|
export function mount(dir?: string): Mountable
|
|
|
|
export function createApp(conf?: object): Five
|
|
}
|
JavaScript
100%