Create koa-pug definitions (#13220)

* Create koa-pug definitions

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI

* Fix CI
This commit is contained in:
Xavier Stouder 2016-12-10 09:35:46 -08:00 committed by Andy
parent 0b2bdb8321
commit 67a9bd38ae
4 changed files with 57 additions and 0 deletions

37
koa-pug/index.d.ts vendored Normal file
View File

@ -0,0 +1,37 @@
// Type definitions for koa-pug 3.0
// Project: https://github.com/chrisyip/koa-pug
// Definitions by: Xavier Stouder <https://github.com/Xstoudi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
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 {
constructor(options?: Pug.PugOptions);
use(app: koa): void;
}
export namespace Pug {
export interface PugOptions {
viewPath?: string;
pretty?: boolean;
compileDebug?: boolean;
debug?: boolean;
locals?: PugLocals;
noCache?: boolean;
helperPath?: string | Array<string | { [str: string]: any }>;
basedir?: string;
app?: koa;
}
export interface PugCtxOptions extends PugOptions {
fromString: boolean;
}
export interface PugLocals { [str: string]: any; }
}

0
koa-pug/koa-pug-tests.ts Normal file
View File

19
koa-pug/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"koa-pug-tests.ts"
]
}

1
koa-pug/tslint.json Normal file
View File

@ -0,0 +1 @@
{ "extends": "../tslint.json" }