core/index.d.ts

29 lines
563 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
}
2024-12-19 15:46:07 +08:00
export default class Five {
2024-12-17 16:09:18 +08:00
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
listen(port?: number, callback?: () => void): this
}
2024-12-18 11:40:00 +08:00
export function mount(dir?: string): array
2024-12-18 11:37:15 +08:00
2024-12-17 16:09:18 +08:00
export function createApp(conf?: object): Five
}