core/index.d.ts

31 lines
585 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: object): this
get(key: string): any
use(middleware: Middleware | Installable, args?: any): this
install(module: Installable, args: any): this
preload(dir: string): this
listen(port?: number, callback?: () => void): this
}
export function createApp(conf?: object): Five
}
一个轻量级的,易学的,拓展性灵活的 nodejs MVC 框架, 5 分钟即可上手。取自"Give me five"之意, 一切就是这么简单
JavaScript 100%