forked from jbaroudi/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jsrender.d.ts
56 lines (44 loc) · 1.52 KB
/
jsrender.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
54
55
56
// Type definitions for JsRender
// Project: http://www.jsviews.com/#jsrender
// Definitions by: Kensuke Matsuzaki <https://github.com/zakki>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
declare module JsRender {
interface Converters {
(name: string, converterFn: (value: any) => any): any;
(namedConverters: any, parentTemplate?: any): any;
html(valueToEncode: string): string;
attr(valueToEncode: string): string;
url(valueToEncode: string): string;
}
interface Views {
converters: Converters;
tags(name: string, tagFn: (value: any) => any): any;
tags(name: string, tagOptions: any): any;
tags(namedTags: any): any;
helpers(name: string, helper: any): any;
helpers(namedHelpers: any, parentTemplate?: any): any;
}
interface Template {
render(data?: any): string;
}
interface NamedTemplate {
(data?: any): string;
}
interface Render {
(data?: any, helpersOrContext?: any): string;
}
interface RenderStatic {
[index: string]: NamedTemplate;
}
}
interface JQuery {
render: JsRender.Render;
}
interface JQueryStatic {
render: JsRender.RenderStatic;
views: JsRender.Views;
templates(markupOrSelector: string): JsRender.Template;
templates(name: string, markupOrSelector: string): JsRender.Template;
templates(namedTemplates: any): any;
}