Files
DefinitelyTyped/mustache/mustache.d.ts
Bobby Powers 8f6209f828 mustache: declare mustache module
Modern mustache defines the 'mustache' module for use under both NPM
and bower.  Define that here so we can use require('mustache') in
TypeScript without complaint.
2015-09-01 09:47:53 -04:00

54 lines
1.4 KiB
TypeScript

// Type definitions for Mustache 0.8.2
// Project: https://github.com/janl/mustache.js
// Definitions by: Mark Ashley Bell <https://github.com/markashleybell/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface MustacheScanner {
string: string;
tail: string;
pos: number;
eos(): boolean;
scan(re: RegExp): string;
scanUntil(re: RegExp): string;
}
interface MustacheContext {
view: any;
parentContext: MustacheContext;
push(view: any): MustacheContext;
lookup(name: string): any;
}
interface MustacheWriter {
(view: any): string;
clearCache(): void;
parse(template: string, tags?: any): any;
render(template: string, view: any, partials: any): string;
renderTokens(tokens: string[], context: MustacheContext, partials: any, originalTemplate: any): string;
}
interface MustacheStatic {
name: string;
version: string;
tags: string;
Scanner: MustacheScanner;
Context: MustacheContext;
Writer: MustacheWriter;
escape: any;
clearCache(): MustacheWriter;
parse(template: string, tags?: any): any;
render(template: string, view: any, partials?: any): string;
to_html(template: string, view: any, partials?: any, send?: any): any;
}
declare var Mustache: MustacheStatic;
declare module 'mustache' {
export = Mustache;
}