core/index.d.ts

31 lines
585 B
TypeScript
Raw Normal View History

2024-12-17 16:09:18 +08:00
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
2024-12-17 16:11:39 +08:00
set(obj: object): this
2024-12-17 16:09:18 +08:00
get(key: string): any
2024-12-17 16:11:39 +08:00
use(middleware: Middleware | Installable, args?: any): this
2024-12-17 16:09:18 +08:00
install(module: Installable, args: any): this
preload(dir: string): this
listen(port?: number, callback?: () => void): this
}
export function createApp(conf?: object): Five
}