[koa-pug] Meet types-2.0 (#13460)

* Meet types-2.0

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts
This commit is contained in:
TonyYang 2016-12-21 01:11:40 +08:00 committed by Andy
parent 128567f711
commit 0510c2ebf7

30
koa-pug/index.d.ts vendored
View File

@ -5,20 +5,18 @@
import * as koa from "koa";
export namespace Koa {
interface Context {
render(viewPath: string, locals?: Pug.PugLocals, overrideOpts?: Pug.PugCtxOptions, noCache?: boolean): void;
// tslint:disable-next-line:unified-signatures
render(pugStr: string, locals?: Pug.PugLocals, overrideOpts?: Pug.PugCtxOptions): void;
// tslint:disable-next-line:unified-signatures
render(pugStr: string, locals?: Pug.PugLocals, noCache?: boolean): void;
}
}
export class Pug {
export = Pug;
/** main module */
declare class Pug {
constructor(options?: Pug.PugOptions);
use(app: koa): void;
}
export namespace Pug {
declare namespace Pug {
export interface PugOptions {
viewPath?: string;
pretty?: boolean;
@ -35,3 +33,13 @@ export namespace Pug {
}
export interface PugLocals { [str: string]: any; }
}
/** plugin */
declare module 'koa' {
interface Context {
render(viewPath: string, locals?: Pug.PugLocals, overrideOpts?: Pug.PugCtxOptions, noCache?: boolean): void;
render(viewPath: string, locals?: Pug.PugLocals, overrideOpts?: boolean): void;
}
}