-
Notifications
You must be signed in to change notification settings - Fork 8
/
riot-ts.d.ts
61 lines (61 loc) · 1.83 KB
/
riot-ts.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
export declare class Observable {
on(events: string, callback: Function): void;
one(events: string, callback: Function): void;
off(events: string): void;
trigger(eventName: string, ...args: any[]): void;
constructor();
}
export interface LifeCycle {
mounted?(F: Function): any;
unmounted?(F: Function): any;
updating?(F: Function): any;
updated?(F: Function): any;
}
export interface HTMLRiotElement extends HTMLElement {
_tag: Element;
}
export declare class Element implements Observable, LifeCycle {
opts: any;
parent: Element;
root: HTMLElement;
tags: any;
tagName: string;
template: string;
isMounted: boolean;
update(data?: any): void;
unmount(keepTheParent?: boolean): void;
on(eventName: string, fun: Function): void;
one(eventName: string, fun: Function): void;
off(events: string): void;
trigger(eventName: string, ...args: any[]): void;
mixin(mixinObject: Object | Function | string, instance?: any): void;
static createElement(options?: any): HTMLRiotElement;
}
export declare var precompiledTags: {
[fileName: string]: CompilerResult;
};
export declare function registerClass(element: Function): void;
export declare function template(template: string): (target: Function) => void;
export interface Router {
(callback: Function): void;
(filter: string, callback: Function): void;
(to: string, title?: string): void;
create(): Router;
start(autoExec?: boolean): void;
stop(): void;
exec(): void;
query(): any;
base(base: string): any;
parser(parser: (path: string) => string, secondParser?: Function): any;
}
export interface CompilerResult {
tagName: string;
html: string;
css: string;
attribs: string;
js: string;
}
export interface Settings {
brackets: string;
}
export as namespace Riot;