forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rivets.d.ts
67 lines (47 loc) · 1.72 KB
/
rivets.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
57
58
59
60
61
62
63
64
65
66
67
// Type definitions for rivets
// Project: http://rivetsjs.com/
// Definitions by: Trevor Baron <https://github.com/TrevorDev>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
declare namespace Rivets {
interface View {
build(): void;
bind(): void;
unbind(): void;
}
interface Rivets {
// Global binders.
binders: Object;
// Global components.
components: Object;
// Global formatters.
formatters: Object;
// Global sightglass adapters.
adapters: Object;
// Default attribute prefix.
prefix: string;
// Default template delimiters.
templateDelimiters: Array<string>;
// Default sightglass root interface.
rootInterface: string;
// Preload data by default.
preloadData: boolean;
handler(context: any, ev: Event, biding: any): void;
configure(options?: {
// Attribute prefix in templates
prefix?: string;
//Preload templates with initial data on bind
preloadData?: boolean;
//Root sightglass interface for keypaths
rootInterface?: string;
// Template delimiters for text bindings
templateDelimiters?: Array<string>
// Augment the event handler of the on-* binder
handler?: Function;
}): void;
bind(element: HTMLElement, models: Object, options?: Object): View;
bind(element: JQuery, models: Object, options?: Object): View;
bind(element: Array<HTMLElement>, models: Object, options?: Object): View;
}
}
declare var rivets: Rivets.Rivets;