import * as Knex from 'knex' import * as Koa from 'koa' import * as Bluebird from 'bluebird'; import * as Logger from 'jinghuan-logger'; type Upload = { pathname: string, filename: string } declare function PropApi(): void; declare function PropAction(props: { auth: boolean, login: boolean }): void; interface JinghuanDb extends Knex.QueryBuilder { sql(sql: string): JinghuanDb logger(logger: Logger): JinghuanDb } interface JinghuanContext extends Koa.Context { module: string; controller: string; action: string; userAgent: string; isGet: boolean; isPost: boolean; body: object | string | number; logger: Logger referer(onlyHost: boolean): string; referrer(onlyHost: boolean): string; isMethod(method: string): boolean; isAjax(method: string): boolean; expires(time: any): any param(name?: string): object; post(name?: string): object | string; file(name?: string): object; download(filepath: string, filename?: string): void; upload(file: string, dir: string, filename: string, filter?: []): Upload db(table: string): JinghuanDb; db(type: symbol, table: string): JinghuanDb; db(transactionScope: (trx: Knex.Transaction) => Promise | Bluebird | void): Promise; db(transactionScope: (type: symbol, trx: Knex.Transaction) => Promise | Bluebird | void): Promise; sql(sql: string): JinghuanDb; config(name: string): object | string | number cache(type: symbol, key: string, val: object | string | number, expire?: number): Promise cache(key: string, val: object | string | number, expire?: number): Promise cache(type: symbol, key: string): Promise cache(key: string): Promise session(type: symbol, key: string, val: object | string | number, expire?: number): Promise session(key: string, val: object | string | number, expire?: number): Promise session(type: symbol, key: string): Promise session(key: string): Promise } interface JinghuanController { ctx: JinghuanContext; userAgent: string; isGet: boolean; isPost: boolean; body: object | string | number; referer(onlyHost: boolean): string; referrer(onlyHost: boolean): string; isMethod(method: string): boolean; isAjax(method: string): boolean; expires(time: number) param(name?: string): object; post(name?: string): object; file(name?: string): object; download(filepath: string, filename?: string): void; upload(file: string, dir: string, filename: string, filter?: string[]): Upload redirect(url: string, alt: string) db(table: string): JinghuanDb; db(type: symbol, table: string): JinghuanDb; db(transactionScope: (trx: Knex.Transaction) => Promise | Bluebird | void): Promise; db(transactionScope: (type: symbol, trx: Knex.Transaction) => Promise | Bluebird | void): Promise; sql(sql: string): JinghuanDb; config(name: string): object | string | number cache(type: symbol, key: string, val: object | string | number, expire?: number): Promise cache(key: string, val: object | string | number, expire?: number): Promise cache(type: symbol, key: string): Promise cache(key: string): Promise session(type: symbol, key: string, val: object | string | number, expire?: number): Promise session(key: string, val: object | string | number, expire?: number): Promise session(type: symbol, key: string): Promise session(key: string): Promise } declare namespace jinghuanjs { const JH_ROOT: string; const APP_PATH: string; const ROOT_PATH: string; const modules: string[]; const modulePaths: object; const mode: string; const source: string; const env: string; const workers: string; const PORT: string; const HOST: string; const paths: string[]; const process_id: number; const watcher: boolean; const version: string; interface Controller extends JinghuanController { } const app: Koa; const logger: Logger }