Skip to content

Instantly share code, notes, and snippets.

@webbiesdk
Created February 16, 2016 11:45
Show Gist options
  • Save webbiesdk/fa0a5ce63b10bd01f9f9 to your computer and use it in GitHub Desktop.
Save webbiesdk/fa0a5ce63b10bd01f9f9 to your computer and use it in GitHub Desktop.
t3.js.d.ts
declare module Box {
export class Context {
constructor (application: any, element: any);
broadcast: (name: any, data: any) => void;
getGlobalConfig: (name: any) => any;
application: any;
getElement: () => any;
getGlobal: (name: any) => any;
reportError: (exception: any) => void;
hasService: (serviceName: string) => boolean;
getService: (serviceName: string) => any;
getConfig: (name: any) => any;
element: any;
}
export module NativeDOM {
export function query(root: Element, selector: string): any;
export var type: string;
export function queryAll(root: Element, selector: string): any;
export function off(element: Element, type: string, listener: any): void;
export function on(element: Element, type: string, listener: any): void;
}
export module DOM {
export function query(root: Element, selector: string): any;
export var type: string;
export function queryAll(root: Element, selector: string): any;
export function off(element: Element, type: string, listener: any): void;
export function on(element: Element, type: string, listener: any): void;
}
export class DOMEventDelegate {
constructor (element: Element, handler: any);
attachEvents: () => void;
detachEvents: () => void;
element: any;
}
export var Application: Box.EventTarget;
export class EventTarget {
constructor ();
broadcast: (name: any, data: any) => Box.EventTarget;
init: (params: any) => Box.EventTarget;
startAll: (root: any) => {start: (arg0: any) => void};
start: (element: Element) => Box.EventTarget;
destroy: () => Box.EventTarget;
reportError: (exception: any) => void;
isStarted: (element: Element) => boolean;
getModuleConfig: (element: Element, name: string) => any;
off: (type: string, handler: any) => void;
addModule: (moduleName: string, creator: any) => any;
getService: (serviceName: string) => any;
addBehavior: (behaviorName: string, creator: any) => any;
stopAll: (root: any) => Box.EventTarget;
getGlobalConfig: (name: string) => any;
stop: (element: {id: string}) => any;
addService: (serviceName: string, creator: any) => any;
setGlobalConfig: (config: any) => any;
fire: (type: string , data: any) => void;
getGlobal: (name: string) => any;
hasService: (serviceName: string) => boolean;
on: (type: string, handler: any) => void;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment