forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mustache.d.ts
53 lines (42 loc) · 1.37 KB
/
mustache.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// 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;
}