forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
backbone.layoutmanager.d.ts
57 lines (43 loc) · 1.67 KB
/
backbone.layoutmanager.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 Backbone.LayoutManager 0.9.5
// Project: http://layoutmanager.org/
// Definitions by: He Jiang <https://github.com/hejiang2000/>
// Definitions: https://github.com/hejiang2000/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../underscore/underscore.d.ts" />
/// <reference path="../backbone/backbone.d.ts" />
declare module Backbone {
interface LayoutOptions<TModel extends Model> extends ViewOptions<TModel> {
template?: string;
views?: { [viewName: string]: View<TModel> };
}
interface LayoutManagerOptions {
manage?: boolean;
el?: boolean;
}
class Layout<TModel extends Model> extends View<TModel> {
template: string;
constructor(options?: LayoutOptions<TModel>);
beforeRender(): void;
afterRender(): void;
cleanup(): void;
fetchTemplate(path: string): (context:any)=>string;
async():(compiled:(context:any)=>void)=>void;
promise(): JQueryPromise<any>;
getAllOptions(): LayoutOptions<TModel>;
getView(fn?:any): any;
getViews(fn?:any): any[];
insertView(selector:any, view?:any): any; // return view;
insertViews(views:any): Layout<TModel>; // return this;
remove(): Layout<TModel>;
removeView(fn:any): Layout<TModel>;
render(): Layout<TModel>; // return this
renderViews(): Layout<TModel>; // return this
setView<U>(name: any, view: U, insert?:boolean): U; // return view
setViews(views:any): Layout<TModel>; // return this
then(fn:()=>void):void;
static cache(path: string, contents?: any): any;
static cleanViews(views: any): void;
static configure(options: LayoutManagerOptions): void;
static setupView(views: any, options?: LayoutOptions<Model>): void;
}
}