Add Jade type definition.

This commit is contained in:
Panu Horsmalahti
2015-10-01 11:46:34 +03:00
parent 386e1708b9
commit 2179e38bad
2 changed files with 29 additions and 0 deletions

10
jade/jade-tests.ts Normal file
View File

@@ -0,0 +1,10 @@
/// <reference path="jade.d.ts"/>
import jade from 'jade';
jade.compile("b")();
jade.compileFile("foo.jade", {})();
jade.compileClient("a")({ a: 1 });
jade.compileClientWithDependenciesTracked("test").body();
jade.render("h1",{});
jade.renderFile("foo.jade");

19
jade/jade.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
// Type definitions for jade
// Project: https://github.com/jadejs/jade
// Definitions by: Panu Horsmalahti <panu.horsmalahti@iki.fi>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'jade' {
module jade {
function compile(template: string, options?: any): (locals?: any) => string;
function compileFile(path: string, options?: any): (locals?: any) => string;
function compileClient(template: string, options?: any): (locals?: any) => string;
function compileClientWithDependenciesTracked(template: string, options?: any): {
body: (locals?: any) => string;
dependencies: string[];
};
function render(template: string, options?: any): string;
function renderFile(path: string, options?: any): string;
}
export default jade;
}