43 lines
823 B
TypeScript
43 lines
823 B
TypeScript
import Request from '@gm5/request'
|
|
import Response from '@gm5/response'
|
|
import Five from '@gm5/core'
|
|
|
|
declare class Controller {
|
|
readonly context: Five
|
|
readonly request: Request
|
|
readonly response: Response
|
|
|
|
readonly method: string
|
|
readonly host: string
|
|
readonly hostname: string
|
|
readonly ua: string
|
|
readonly jwt: {
|
|
result: object | null
|
|
sign(data: object): string
|
|
verify(token?: string): boolean
|
|
}
|
|
|
|
assign(key: string | number, val: any): void
|
|
|
|
render(file: string, noParse?: boolean): void
|
|
|
|
cookie(key: string): string
|
|
|
|
cookie(
|
|
key: string,
|
|
val: any,
|
|
opt?: {
|
|
domain?: string
|
|
expires?: Date
|
|
maxAge?: number
|
|
[key: string]: any
|
|
}
|
|
): void
|
|
|
|
session(key: string): Promise<any>
|
|
|
|
session(key: string, val: any): void
|
|
}
|
|
|
|
export default Controller
|