");
+ ```
+ $.create("div",{id:'main',innerHTML:'this is some text'});
+ $.create("
this is some text
");
+ ```
+ * @param {String} DOM Element type or html
+ * @param [{Object}] properties to apply to the element
+ * @return {Object} Returns an appframework object
+ * @title $.create(type,[params])
+ */
+ create(type: string, params?: any): appFrameworkCollection;
+
+ /**
+ * $.query - a faster alertnative to $("div");
+ ```
+ $.query(".panel");
+ ```
+ * @param {String} selector
+ * @param {Object} [context]
+ * @return {Object} Returns an appframework object
+ * @title $.query(selector,[context])
+ */
+ query(selector: string, context?: any): appFrameworkCollection;
+
+ /**
+ * Creates a custom event to be used internally.
+ * @param {String} type
+ * @param {Object} [properties]
+ * @return {event} a custom event that can then be dispatched
+ * @title $.Event(type,props);
+ */
+ Event(type: string, props: any): any;
+
+ /* The following are for events on objects */
+ /**
+ * Bind an event to an object instead of a DOM Node
+ ```
+ $.bind(this,'event',function(){});
+ ```
+ * @param {Object} object
+ * @param {String} event name
+ * @param {Function} function to execute
+ * @title $.bind(object,event,function);
+ */
+ bind(object: any, event: string, fn: Function): void;
+
+ /**
+ * Trigger an event to an object instead of a DOM Node
+ ```
+ $.trigger(this,'event',arguments);
+ ```
+ * @param {Object} object
+ * @param {String} event name
+ * @param {Array} arguments
+ * @title $.trigger(object,event,argments);
+ */
+ trigger(object: any, event: string, args?: any[]): void;
+
+ /**
+ * Unbind an event to an object instead of a DOM Node
+ ```
+ $.unbind(this,'event',function(){});
+ ```
+ * @param {Object} object
+ * @param {String} event name
+ * @param {Function} function to execute
+ * @title $.unbind(object,event,function);
+ */
+ unbind(object: any, event: string, fn: Function): void;
+
+ /**
+ * Creates a proxy function so you can change the 'this' context in the function
+ * Update: now also allows multiple argument call or for you to pass your own arguments
+ ```
+ var newObj={foo:bar}
+ $("#main").bind("click",$.proxy(function(evt){console.log(this)},newObj);
+
+ or
+
+ ( $.proxy(function(foo, bar){console.log(this+foo+bar)}, newObj) )('foo', 'bar');
+
+ or
+
+ ( $.proxy(function(foo, bar){console.log(this+foo+bar)}, newObj, ['foo', 'bar']) )();
+ ```
+ * @param {Function} Callback
+ * @param {Object} Context
+ * @title $.proxy(callback,context);
+ */
+ proxy(callback: Function, context: any): void;
+
+ /**
+ * Function to clean up node content to prevent memory leaks
+ ```
+ $.cleanUpContent(node,itself,kill)
+ ```
+ * @param {HTMLNode} node
+ * @param {Bool} kill itself
+ * @param {bool} Kill nodes
+ * @title $.cleanUpContent(node,itself,kill)
+ */
+ cleanUpContent(node: HTMLElement, itself?: boolean, kill?: boolean): void;
+
+ /**
+ * This adds a command to execute in the JS stack, but is faster then setTimeout
+ ```
+ $.asap(function,context,args)
+ ```
+ * @param {Function} function
+ * @param {Object} context
+ * @param {Array} arguments
+ */
+ asap(callback: Function, context?: any, args?: any[]): void;
+
+ /**
+ * this function executes javascript in HTML.
+ ```
+ $.parseJS(content)
+ ```
+ * @param {String|DOM} content
+ * @title $.parseJS(content);
+ */
+ parseJS(content: string): void;
+ parseJS(content: HTMLElement): void;
+
+ /**
+ * Helper function to parse the user agent. Sets the following
+ * .os.webkit
+ * .os.android
+ * .os.ipad
+ * .os.iphone
+ * .os.webos
+ * .os.touchpad
+ * .os.blackberry
+ * .os.opera
+ * .os.fennec
+ * .os.ie
+ * .os.ieTouch
+ * .os.supportsTouch
+ * .os.playbook
+ * .feat.nativetouchScroll
+ * @api private
+ */
+ os: {
+ webkit: boolean;
+ android: boolean;
+ androidICS: boolean;
+ ipad: boolean;
+ iphone: boolean;
+ ios7: boolean;
+ webos: boolean;
+ touchpad: boolean;
+ ios: boolean;
+ playbook: boolean;
+ blackberry: boolean;
+ blackberry10: boolean;
+ chrome: boolean;
+ opera: boolean;
+ fennec: boolean;
+ ie: boolean;
+ ieTouch: boolean;
+ supportsTouch: boolean;
+ };
+
+ feat: {
+ nativeTouchScroll: boolean;
+ cssPrefix: string;
+ cssTransformStart: string;
+ cssTransformEnd: string;
+ }
+}
+
+interface appFrameworkCollection {
+ reduce(callbackfn: (previousValue: appFrameworkCollection, currentValue: appFrameworkCollection, currentIndex: number, array: appFrameworkCollection[]) => appFrameworkCollection, initialValue?: appFrameworkCollection): appFrameworkCollection;
+ push(...items: appFrameworkCollection[]): number;
+ indexOf(searchElement: appFrameworkCollection, fromIndex?: number): number;
+ concat(...items: appFrameworkCollection[]): appFrameworkCollection[];
+ slice(start: number, end?: number): appFrameworkCollection[];
+ length: number;
+
+ /**
+ * This is a wrapper to $.map on the selected elements
+ ```
+ $().map(function(){this.value+=ind});
+ ```
+
+ * @param {Function} callback
+ * @return {Object} an appframework object
+ * @title $().map(function)
+ */
+ map(fn: (index: number, item: any) => any): appFrameworkCollection;
+ /**
+ * Iterates through all elements and applys a callback function
+ ```
+ $().each(function(){console.log(this.value)});
+ ```
+
+ * @param {Function} callback
+ * @return {Object} an appframework object
+ * @title $().each(function)
+ */
+ each(fn: (index: number, item: any) => any): appFrameworkCollection;
+ forEach(fn: (item: any, index: number) => any): void;
+
+ /**
+ * This is executed when DOMContentLoaded happens, or after if you've registered for it.
+ ```
+ $(document).ready(function(){console.log('I'm ready');});
+ ```
+
+ * @param {Function} callback
+ * @return {Object} an appframework object
+ * @title $().ready(function)
+ */
+ ready(fn: Function): appFrameworkStatic;
+
+ /**
+ * Searches through the collection and reduces them to elements that match the selector
+ ```
+ $("#foo").find('.bar');
+ $("#foo").find($('.bar'));
+ $("#foo").find($('.bar').get(0));
+ ```
+
+ * @param {String|Object|Array} selector
+ * @return {Object} an appframework object filtered
+ * @title $().find(selector)
+
+ */
+ find(selector: string): appFrameworkCollection;
+
+ /**
+ * Gets or sets the innerHTML for the collection.
+ * If used as a get, the first elements innerHTML is returned
+ ```
+ $("#foo").html(); //gets the first elements html
+ $("#foo").html('new html');//sets the html
+ $("#foo").html('new html',false); //Do not do memory management cleanup
+ ```
+
+ * @param {String} html to set
+ * @param {Bool} [cleanup] - set to false for performance tests and if you do not want to execute memory management cleanup
+ * @return {Object} an appframework object
+ * @title $().html([html])
+ */
+ html(): string;
+ html(html: string): appFrameworkCollection;
+ html(html: string, cleanup: boolean): appFrameworkCollection;
+
+ /**
+ * Gets or sets the innerText for the collection.
+ * If used as a get, the first elements innerText is returned
+ ```
+ $("#foo").text(); //gets the first elements text;
+ $("#foo").text('new text'); //sets the text
+ ```
+
+ * @param {String} text to set
+ * @return {Object} an appframework object
+ * @title $().text([text])
+ */
+ text(): string;
+ text(text: string): appFrameworkCollection;
+
+ /**
+ * Gets or sets a css property for the collection
+ * If used as a get, the first elements css property is returned
+ * This will add px to properties that need it.
+ ```
+ $().css("background"); // Gets the first elements background
+ $().css("background","red") //Sets the elements background to red
+ ```
+
+ * @param {String} attribute to get
+ * @param {String} value to set as
+ * @return {Object} an appframework object
+ * @title $().css(attribute,[value])
+ */
+ css(property: string): any;
+ css(property: string, value: any): appFrameworkCollection;
+ css(properties: any): appFrameworkCollection;
+
+ /**
+ * Performs a css vendor specific transform:translate operation on the collection.
+ *
+ ```
+ $("#main").cssTranslate('200px,0,0');
+ ```
+ * @param {String} Transform values
+ * @return {Object} an appframework object
+ * @title $().vendorCss(value)
+ */
+ vendorCss(transform: string): appFrameworkCollection;
+
+ /**
+ * Gets the computed style of CSS values
+ *
+ ```
+ $("#main").computedStyle('display');
+ ```
+ * @param {String} css property
+ * @return {Int|String|Float|} css vlaue
+ * @title $().computedStyle()
+ */
+ computedStyle(css: string): appFrameworkCollection;
+
+ /**
+ * Sets the innerHTML of all elements to an empty string
+ ```
+ $().empty();
+ ```
+
+ * @return {Object} an appframework object
+ * @title $().empty()
+ */
+ empty(): appFrameworkCollection;
+
+ /**
+ * Sets the elements display property to "none".
+ * This will also store the old property into an attribute for hide
+ ```
+ $().hide();
+ ```
+
+ * @return {Object} an appframework object
+ * @title $().hide()
+ */
+ hide(): appFrameworkCollection;
+
+ /**
+ * Shows all the elements by setting the css display property
+ * We look to see if we were retaining an old style (like table-cell) and restore that, otherwise we set it to block
+ ```
+ $().show();
+ ```
+
+ * @return {Object} an appframework object
+ * @title $().show()
+ */
+ show(): appFrameworkCollection;
+
+ /**
+ * Toggle the visibility of a div
+ ```
+ $().toggle();
+ $().toggle(true); //force showing
+ ```
+
+ * @param {Boolean} [show] -force the hiding or showing of the element
+ * @return {Object} an appframework object
+ * @title $().toggle([show])
+ */
+ toggle(show?: boolean): appFrameworkCollection;
+
+ /**
+ * Gets or sets an elements value
+ * If used as a getter, we return the first elements value. If nothing is in the collection, we return undefined
+ ```
+ $().value; //Gets the first elements value;
+ $().value="bar"; //Sets all elements value to bar
+ ```
+
+ * @param {String} [value] to set
+ * @return {String|Object} A string as a getter, appframework object as a setter
+ * @title $().val([value])
+ */
+ val(): string;
+ val(value: string): appFrameworkCollection;
+
+ /**
+ * Gets or sets an attribute on an element
+ * If used as a getter, we return the first elements value. If nothing is in the collection, we return undefined
+ ```
+ $().attr("foo"); //Gets the first elements 'foo' attribute
+ $().attr("foo","bar");//Sets the elements 'foo' attribute to 'bar'
+ $().attr("foo",{bar:'bar'}) //Adds the object to an internal cache
+ ```
+
+ * @param {String|Object} attribute to act upon. If it's an object (hashmap), it will set the attributes based off the kvp.
+ * @param {String|Array|Object|function} [value] to set
+ * @return {String|Object|Array|Function} If used as a getter, return the attribute value. If a setter, return an appframework object
+ * @title $().attr(attribute,[value])
+ */
+ attr(attribute: string): any;
+ attr(attributeHash: Object): appFrameworkCollection;
+ attr(attribute: string, value: string): appFrameworkCollection;
+ attr(attribute: string, value: any): appFrameworkCollection;
+
+ /**
+ * Removes an attribute on the elements
+ ```
+ $().removeAttr("foo");
+ ```
+
+ * @param {String} attributes that can be space delimited
+ * @return {Object} appframework object
+ * @title $().removeAttr(attribute)
+ */
+ removeAttr(attribute: string): appFrameworkCollection;
+
+ /**
+ * Gets or sets a property on an element
+ * If used as a getter, we return the first elements value. If nothing is in the collection, we return undefined
+ ```
+ $().prop("foo"); //Gets the first elements 'foo' property
+ $().prop("foo","bar");//Sets the elements 'foo' property to 'bar'
+ $().prop("foo",{bar:'bar'}) //Adds the object to an internal cache
+ ```
+
+ * @param {String|Object} property to act upon. If it's an object (hashmap), it will set the attributes based off the kvp.
+ * @param {String|Array|Object|function} [value] to set
+ * @return {String|Object|Array|Function} If used as a getter, return the property value. If a setter, return an appframework object
+ * @title $().prop(property,[value])
+ */
+ prop(attribute: string): any;
+ prop(attributeHash: Object): appFrameworkCollection;
+ prop(attribute: string, value: string): appFrameworkCollection;
+ prop(attribute: string, value: any): appFrameworkCollection;
+
+ /**
+ * Removes a property on the elements
+ ```
+ $().removeProp("foo");
+ ```
+
+ * @param {String} properties that can be space delimited
+ * @return {Object} appframework object
+ * @title $().removeProp(attribute)
+ */
+ removeProp(attribute: string): appFrameworkCollection;
+
+ /**
+ * Removes elements based off a selector
+ ```
+ $().remove(); //Remove all
+ $().remove(".foo");//Remove off a string selector
+ var element=$("#foo").get(0);
+ $().remove(element); //Remove by an element
+ $().remove($(".foo")); //Remove by a collection
+
+ ```
+
+ * @param {String|Object|Array} selector to filter against
+ * @return {Object} appframework object
+ * @title $().remove(selector)
+ */
+ remove(): appFrameworkCollection;
+ remove(selector: string): appFrameworkCollection;
+ remove(element: HTMLElement): appFrameworkCollection;
+ remove(elements: any[]): appFrameworkCollection;
+ remove(elements: appFrameworkCollection): appFrameworkCollection;
+
+ /**
+ * Adds a css class to elements.
+ ```
+ $().addClass("selected");
+ ```
+
+ * @param {String} classes that are space delimited
+ * @return {Object} appframework object
+ * @title $().addClass(name)
+ */
+ addClass(className: string): appFrameworkCollection;
+
+ /**
+ * Removes a css class from elements.
+ ```
+ $().removeClass("foo"); //single class
+ $().removeClass("foo selected");//remove multiple classess
+ ```
+
+ * @param {String} classes that are space delimited
+ * @return {Object} appframework object
+ * @title $().removeClass(name)
+ */
+ removeClass(className: string): appFrameworkCollection;
+
+ /**
+ * Adds or removes a css class to elements.
+ ```
+ $().toggleClass("selected");
+ ```
+
+ * @param {String} classes that are space delimited
+ * @param {Boolean} [state] force toggle to add or remove classes
+ * @return {Object} appframework object
+ * @title $().toggleClass(name)
+ */
+ toggleClass(name: string, state?: boolean): appFrameworkCollection;
+
+ /**
+ * Replaces a css class on elements.
+ ```
+ $().replaceClass("on", "off");
+ ```
+
+ * @param {String} classes that are space delimited
+ * @param {String} classes that are space delimited
+ * @return {Object} appframework object
+ * @title $().replaceClass(old, new)
+ */
+ replaceClass(oldClassName: string, newClassName: string): appFrameworkCollection;
+
+ /**
+ * Checks to see if an element has a class.
+ ```
+ $().hasClass('foo');
+ $().hasClass('foo',element);
+ ```
+
+ * @param {String} class name to check against
+ * @param {Object} [element] to check against
+ * @return {Boolean}
+ * @title $().hasClass(name,[element])
+ */
+ hasClass(className: string, element: HTMLElement): boolean;
+
+ /**
+ * Appends to the elements
+ * We boil everything down to an appframework object and then loop through that.
+ * If it's HTML, we create a dom element so we do not break event bindings.
+ * if it's a script tag, we evaluate it.
+ ```
+ $().append(""); //Creates the object from the string and appends it
+ $().append($("#foo")); //Append an object;
+ ```
+
+ * @param {String|Object} Element/string to add
+ * @param {Boolean} [insert] insert or append
+ * @return {Object} appframework object
+ * @title $().append(element,[insert])
+ */
+ append(content: any): appFrameworkCollection;
+
+ /**
+ * Appends the current collection to the selector
+ ```
+ $().appendTo("#foo"); //Append an object;
+ ```
+
+ * @param {String|Object} Selector to append to
+ * @param {Boolean} [insert] insert or append
+ * @title $().appendTo(element,[insert])
+ */
+ appendTo(target: any): appFrameworkCollection;
+
+ /**
+ * Prepends the current collection to the selector
+ ```
+ $().prependTo("#foo"); //Prepend an object;
+ ```
+
+ * @param {String|Object} Selector to prepent to
+ * @title $().prependTo(element)
+ */
+ prependTo(target: any): appFrameworkCollection;
+
+ /**
+ * Prepends to the elements
+ * This simply calls append and sets insert to true
+ ```
+ $().prepend("");//Creates the object from the string and appends it
+ $().prepend($("#foo")); //Prepends an object
+ ```
+
+ * @param {String|Object} Element/string to add
+ * @return {Object} appframework object
+ * @title $().prepend(element)
+ */
+ prepend(content: any): appFrameworkCollection;
+
+ /**
+ * Inserts collection before the target (adjacent)
+ ```
+ $().insertBefore(af("#target"));
+ ```
+
+ * @param {String|Object} Target
+ * @title $().insertBefore(target);
+ */
+ insertBefore(target: any): appFrameworkCollection;
+
+ /**
+ * Inserts collection after the target (adjacent)
+ ```
+ $().insertAfter(af("#target"));
+ ```
+ * @param {String|Object} target
+ * @title $().insertAfter(target);
+ */
+ insertAfter(target: any): void;
+
+ /**
+ * Returns the raw DOM element.
+ ```
+ $().get(0); //returns the first element
+ $().get(2);// returns the third element
+ ```
+
+ * @param {Int} [index]
+ * @return {Object} raw DOM element
+ * @title $().get([index])
+ */
+ get(): HTMLElement[];
+ get(index: number): HTMLElement;
+
+ /**
+ * Returns the offset of the element, including traversing up the tree
+ ```
+ $().offset();
+ ```
+
+ * @return {Object} with left, top, width and height properties
+ * @title $().offset()
+ */
+ offset(): {
+ left: number;
+ top: number;
+ right: number;
+ bottom: number;
+ width: number;
+ height: number;
+ };
+
+ /**
+ * returns the height of the element, including padding on IE
+ ```
+ $().height();
+ ```
+ * @return {string} height
+ * @title $().height()
+ */
+ height(): string;
+
+ /**
+ * returns the width of the element, including padding on IE
+ ```
+ $().width();
+ ```
+ * @return {string} width
+ * @title $().width()
+ */
+ width(): string;
+
+ /**
+ * Returns the parent nodes of the elements based off the selector
+ ```
+ $("#foo").parent('.bar');
+ $("#foo").parent($('.bar'));
+ $("#foo").parent($('.bar').get(0));
+ ```
+
+ * @param {String|Array|Object} [selector]
+ * @return {Object} appframework object with unique parents
+ * @title $().parent(selector)
+ */
+ parent(selector?: any): appFrameworkCollection;
+
+ /**
+ * Returns the parents of the elements based off the selector (traversing up until html document)
+ ```
+ $("#foo").parents('.bar');
+ $("#foo").parents($('.bar'));
+ $("#foo").parents($('.bar').get(0));
+ ```
+
+ * @param {String|Array|Object} [selector]
+ * @return {Object} appframework object with unique parents
+ * @title $().parents(selector)
+ */
+ parents(selector?: any): appFrameworkCollection;
+
+ /**
+ * Returns the child nodes of the elements based off the selector
+ ```
+ $("#foo").children('.bar'); //Selector
+ $("#foo").children($('.bar')); //Objects
+ $("#foo").children($('.bar').get(0)); //Single element
+ ```
+
+ * @param {String|Array|Object} [selector]
+ * @return {Object} appframework object with unique children
+ * @title $().children(selector)
+ */
+ children(selector?: any): appFrameworkCollection;
+
+ /**
+ * Returns the siblings of the element based off the selector
+ ```
+ $("#foo").siblings('.bar'); //Selector
+ $("#foo").siblings($('.bar')); //Objects
+ $("#foo").siblings($('.bar').get(0)); //Single element
+ ```
+
+ * @param {String|Array|Object} [selector]
+ * @return {Object} appframework object with unique siblings
+ * @title $().siblings(selector)
+ */
+ siblings(selector?: any): appFrameworkCollection;
+
+ /**
+ * Returns the closest element based off the selector and optional context
+ ```
+ $("#foo").closest('.bar'); //Selector
+ $("#foo").closest($('.bar')); //Objects
+ $("#foo").closest($('.bar').get(0)); //Single element
+ ```
+
+ * @param {String|Array|Object} selector
+ * @param {Object} [context]
+ * @return {Object} Returns an appframework object with the closest element based off the selector
+ * @title $().closest(selector,[context]);
+ */
+ closest(selector?: any): appFrameworkCollection;
+
+ /**
+ * Filters elements based off the selector
+ ```
+ $("#foo").filter('.bar'); //Selector
+ $("#foo").filter($('.bar')); //Objects
+ $("#foo").filter($('.bar').get(0)); //Single element
+ ```
+
+ * @param {String|Array|Object} selector
+ * @return {Object} Returns an appframework object after the filter was run
+ * @title $().filter(selector);
+ */
+ filter(selector?: any): appFrameworkCollection;
+
+ /**
+ * Basically the reverse of filter. Return all elements that do NOT match the selector
+ ```
+ $("#foo").not('.bar'); //Selector
+ $("#foo").not($('.bar')); //Objects
+ $("#foo").not($('.bar').get(0)); //Single element
+ ```
+
+ * @param {String|Array|Object} selector
+ * @return {Object} Returns an appframework object after the filter was run
+ * @title $().not(selector);
+ */
+ not(selector?: any): appFrameworkCollection;
+
+ /**
+ * Gets or set data-* attribute parameters on elements (when a string)
+ * When used as a getter, it's only the first element
+ ```
+ $().data("foo"); //Gets the data-foo attribute for the first element
+ $().data("foo","bar"); //Sets the data-foo attribute for all elements
+ $().data("foo",{bar:'bar'});//object as the data
+ ```
+
+ * @param {String} key
+ * @param {String|Array|Object} value
+ * @return {String|Object} returns the value or appframework object
+ * @title $().data(key,[value]);
+ */
+ data(attribute: string): any;
+ data(attribute: string, value: string): appFrameworkCollection;
+ data(attribute: string, value: any): appFrameworkCollection;
+
+ /**
+ * Rolls back the appframework elements when filters were applied
+ * This can be used after .not(), .filter(), .children(), .parent()
+ ```
+ $().filter(".panel").end(); //This will return the collection BEFORE filter is applied
+ ```
+
+ * @return {Object} returns the previous appframework object before filter was applied
+ * @title $().end();
+ */
+ end(): appFrameworkCollection;
+
+ /**
+ * Clones the nodes in the collection.
+ ```
+ $().clone();// Deep clone of all elements
+ $().clone(false); //Shallow clone
+ ```
+
+ * @param {Boolean} [deep] - do a deep copy or not
+ * @return {Object} appframework object of cloned nodes
+ * @title $().clone();
+ */
+ clone(deep?: boolean): appFrameworkCollection;
+
+ /**
+ * Returns the number of elements in the collection
+ ```
+ $().size();
+ ```
+
+ * @return {Int}
+ * @title $().size();
+ */
+ size(): number;
+
+ /**
+ * Serailizes a form into a query string
+ ```
+ $().serialize();
+ ```
+ * @return {String}
+ * @title $().serialize()
+ */
+ serialize(): string;
+
+ /* added in 1.2 */
+ /**
+ * Reduce the set of elements based off index
+ ```
+ $().eq(index)
+ ```
+ * @param {Int} index - Index to filter by. If negative, it will go back from the end
+ * @return {Object} appframework object
+ * @title $().eq(index)
+ */
+ eq(index: number): appFrameworkCollection;
+
+ /**
+ * Returns the index of the selected element in the collection
+ ```
+ $().index(elem)
+ ```
+ * @param {String|Object} element to look for. Can be a selector or object
+ * @return integer - index of selected element
+ * @title $().index(elem)
+ */
+ index(): number;
+ index(selector: any): number;
+
+ /**
+ * Returns boolean if the object is a type of the selector
+ ```
+ $().is(selector)
+ ```
+ * param {String|Object} selector to act upon
+ * @return boolean
+ * @title $().is(selector)
+ */
+ is(selector: any): number;
+
+ /**
+ * Binds an event to each element in the collection and executes the callback
+ ```
+ $().bind('click',function(){console.log('I clicked '+this.id);});
+ ```
+
+ * @param {String|Object} event
+ * @param {Function} callback
+ * @return {Object} appframework object
+ * @title $().bind(event,callback)
+ */
+ bind(eventHash: Object): appFrameworkCollection;
+ bind(eventName: string, fn: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ * Unbinds an event to each element in the collection. If a callback is passed in, we remove just that one, otherwise we remove all callbacks for those events
+ ```
+ $().unbind('click'); //Unbinds all click events
+ $().unbind('click',myFunc); //Unbinds myFunc
+ ```
+
+ * @param {String|Object} event
+ * @param {Function} [callback]
+ * @return {Object} appframework object
+ * @title $().unbind(event,[callback]);
+ */
+ unbind(eventHash: {}): appFrameworkCollection;
+ unbind(eventName?: string): appFrameworkCollection;
+ unbind(eventName: string, fn?: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ * Binds an event to each element in the collection that will only execute once. When it executes, we remove the event listener then right away so it no longer happens
+ ```
+ $().one('click',function(){console.log('I was clicked once');});
+ ```
+
+ * @param {String|Object} event
+ * @param {Function} [callback]
+ * @return appframework object
+ * @title $().one(event,callback);
+ */
+ one(eventHash: {}): appFrameworkCollection;
+ one(eventName: string, fn: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ * Delegate an event based off the selector. The event will be registered at the parent level, but executes on the selector.
+ ```
+ $("#div").delegate("p",'click',callback);
+ ```
+
+ * @param {String|Array|Object} selector
+ * @param {String|Object} event
+ * @param {Function} callback
+ * @return {Object} appframework object
+ * @title $().delegate(selector,event,callback)
+ */
+ delegate(selector: any, eventHash: {}): appFrameworkCollection;
+ delegate(selector: any, eventName: string, fn: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ * Unbinds events that were registered through delegate. It acts upon the selector and event. If a callback is specified, it will remove that one, otherwise it removes all of them.
+ ```
+ $("#div").undelegate("p",'click',callback);//Undelegates callback for the click event
+ $("#div").undelegate("p",'click');//Undelegates all click events
+ ```
+
+ * @param {String|Array|Object} selector
+ * @param {String|Object} event
+ * @param {Function} callback
+ * @return {Object} appframework object
+ * @title $().undelegate(selector,event,[callback]);
+ */
+ undelegate(selector: any, eventHash: {}): appFrameworkCollection;
+ undelegate(selector: any, eventName: string, fn: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ * Similar to delegate, but the function parameter order is easier to understand.
+ * If selector is undefined or a function, we just call .bind, otherwise we use .delegate
+ ```
+ $("#div").on("click","p",callback);
+ ```
+
+ * @param {String|Array|Object} selector
+ * @param {String|Object} event
+ * @param {Function} callback
+ * @return {Object} appframework object
+ * @title $().on(event,selector,callback);
+ */
+ on(eventHash: {}, selector?: any): appFrameworkCollection;
+ on(eventName: string, fn: (e: Event) => any): appFrameworkCollection;
+ on(eventName: string, selector: string, fn: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ * Removes event listeners for .on()
+ * If selector is undefined or a function, we call unbind, otherwise it's undelegate
+ ```
+ $().off("click","p",callback); //Remove callback function for click events
+ $().off("click","p") //Remove all click events
+ ```
+
+ * @param {String|Object} event
+ * @param {String|Array|Object} selector
+ * @param {Sunction} callback
+ * @return {Object} appframework object
+ * @title $().off(event,selector,[callback])
+ */
+ off(eventHash: {}, selector?: any): appFrameworkCollection;
+ off(eventName: string, fn: (e: Event) => any): appFrameworkCollection;
+ off(eventName: string, selector: string, fn: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ This triggers an event to be dispatched. Usefull for emulating events, etc.
+ ```
+ $().trigger("click",{foo:'bar'});//Trigger the click event and pass in data
+ ```
+
+ * @param {String|Object} event
+ * @param {Object} [data]
+ * @return {Object} appframework object
+ * @title $().trigger(event,data);
+ */
+ trigger(eventName: string, data?: any): appFrameworkCollection;
+ trigger(eventHash: {}, data?: any): appFrameworkCollection;
+
+ /**
+ custom events since people want to do $().click instead of $().bind("click")
+ */
+ click(fn?: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ custom events since people want to do $().keydown instead of $().bind("keydown")
+ */
+ keydown(fn?: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ custom events since people want to do $().keyup instead of $().bind("keyup")
+ */
+ keyup(fn?: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ custom events since people want to do $().keypress instead of $().bind("keypress")
+ */
+ keypress(fn?: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ custom events since people want to do $().submit instead of $().bind("submit")
+ */
+ submit(fn?: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ custom events since people want to do $().load instead of $().bind("load")
+ */
+ load(fn?: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ custom events since people want to do $().resize instead of $().bind("resize")
+ */
+ resize(fn?: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ custom events since people want to do $().change instead of $().bind("change")
+ */
+ change(fn?: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ custom events since people want to do $().select instead of $().bind("select")
+ */
+ select(fn?: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ custom events since people want to do $().error instead of $().bind("error")
+ */
+ error(fn?: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ custom events since people want to do $().focus instead of $().bind("focus")
+ */
+ focus(fn?: (e: Event) => any): appFrameworkCollection;
+
+ /**
+ custom events since people want to do $().blur instead of $().bind("blur")
+ */
+ blur(fn?: (e: Event) => any): appFrameworkCollection;
+}
+
+interface appFrameworkAjaxSettings {
+ type?: string;
+ beforeSend?: (xhr: XMLHttpRequest, settings: appFrameworkAjaxSettings) => boolean;
+ success?: (data: any, status: string, xhr: XMLHttpRequest) => void;
+ error?: (xhr: XMLHttpRequest, errorType: string, error: Error) => void;
+ complete?: (xhr: XMLHttpRequest, status: string) => void;
+ timeout?: number;
+ url?: string;
+ contentType?: string;
+ headers?: any;
+ dataType?: string;
+ data?: any;
+ context?: any;
+ crossDomain?: boolean;
+}
+
+interface appFrameworkCssMatrix {
+ a: number;
+ b: number;
+ c: number;
+ d: number;
+ e: number;
+ f: number;
+}
+
+declare var af: (fn: ($: appFrameworkStatic) => void) => void;
+declare var $: appFrameworkStatic;
diff --git a/arbiter/Arbiter-tests.ts.tscparams b/arbiter/Arbiter-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/arbiter/Arbiter-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/arbiter/Arbiter.d.ts.tscparams b/arbiter/Arbiter.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/arbiter/Arbiter.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/async/async-tests.ts.tscparams b/async/async-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/async/async-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/async/async.d.ts b/async/async.d.ts
index 5ba56e0dbb..12aa4123f3 100644
--- a/async/async.d.ts
+++ b/async/async.d.ts
@@ -13,7 +13,7 @@ interface AsyncWorker { (task: T, callback: Function): void; }
interface AsyncQueue {
length(): number;
concurrency: number;
- push(task: T, callback: AsyncMultipleResultsCallback): void;
+ push(task: T, callback?: AsyncMultipleResultsCallback): void;
saturated: AsyncMultipleResultsCallback;
empty: AsyncMultipleResultsCallback;
drain: AsyncMultipleResultsCallback;
@@ -79,4 +79,4 @@ declare var async: Async;
declare module "async" {
export = async;
-}
\ No newline at end of file
+}
diff --git a/async/async.d.ts.tscparams b/async/async.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/async/async.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/async/asyncamd-tests.ts.tscparams b/async/asyncamd-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/async/asyncamd-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/azure-mobile-services-client/AzureMobileServicesClient-tests.ts.tscparams b/azure-mobile-services-client/AzureMobileServicesClient-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/azure-mobile-services-client/AzureMobileServicesClient-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/backbone-relational/backbone-relational-tests.ts.tscparams b/backbone-relational/backbone-relational-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/backbone-relational/backbone-relational-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/backbone-relational/backbone-relational.d.ts.tscparams b/backbone-relational/backbone-relational.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/backbone-relational/backbone-relational.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/backbone/backbone-tests.ts.tscparams b/backbone/backbone-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/backbone/backbone-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts
index e2579c407f..3902d8ffd0 100644
--- a/backbone/backbone.d.ts
+++ b/backbone/backbone.d.ts
@@ -67,16 +67,16 @@ declare module Backbone {
}
class Events {
- on(eventName: any, callback?: (...args: any[]) => void , context?: any): any;
- off(eventName?: string, callback?: (...args: any[]) => void , context?: any): any;
+ on(eventName: any, callback?: Function, context?: any): any;
+ off(eventName?: string, callback?: Function, context?: any): any;
trigger(eventName: string, ...args: any[]): any;
- bind(eventName: string, callback: (...args: any[]) => void , context?: any): any;
- unbind(eventName?: string, callback?: (...args: any[]) => void , context?: any): any;
+ bind(eventName: string, callback: Function, context?: any): any;
+ unbind(eventName?: string, callback?: Function, context?: any): any;
- once(events: string, callback: (...args: any[]) => void , context?: any): any;
- listenTo(object: any, events: string, callback: (...args: any[]) => void ): any;
- listenToOnce(object: any, events: string, callback: (...args: any[]) => void ): any;
- stopListening(object?: any, events?: string, callback?: (...args: any[]) => void ): any;
+ once(events: string, callback: Function, context?: any): any;
+ listenTo(object: any, events: string, callback: Function): any;
+ listenToOnce(object: any, events: string, callback: Function): any;
+ stopListening(object?: any, events?: string, callback?: Function): any;
}
class ModelBase extends Events {
@@ -248,7 +248,7 @@ declare module Backbone {
constructor(options?: RouterOptions);
initialize(options?: RouterOptions);
- route(route: string, name: string, callback?: (...parameter: any[]) => void );
+ route(route: string, name: string, callback?: Function);
navigate(fragment: string, options?: NavigateOptions);
navigate(fragment: string, trigger?: boolean);
@@ -269,7 +269,7 @@ declare module Backbone {
getHash(window?: Window): string;
getFragment(fragment?: string, forcePushState?: boolean): string;
stop(): void;
- route(route: string, callback: (...args: any[]) => void );
+ route(route: string, callback: Function);
checkUrl(e?: any): void;
loadUrl(fragmentOverride: string): boolean;
navigate(fragment: string, options?: any);
@@ -339,4 +339,3 @@ declare module Backbone {
function setDomLibrary(jQueryNew);
}
-
diff --git a/backbone/backbone.d.ts.tscparams b/backbone/backbone.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/backbone/backbone.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/backgrid/backgrid.d.ts.tscparams b/backgrid/backgrid.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/backgrid/backgrid.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/bootstrap-notify/bootstrap-notify.d.ts.tscparams b/bootstrap-notify/bootstrap-notify.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/bootstrap-notify/bootstrap-notify.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/bootstrap.datepicker/bootstrap.datepicker-tests.ts.tscparams b/bootstrap.datepicker/bootstrap.datepicker-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/bootstrap.datepicker/bootstrap.datepicker-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/bootstrap.datepicker/bootstrap.datepicker.d.ts b/bootstrap.datepicker/bootstrap.datepicker.d.ts
index 9be7bccc24..4cf27ef199 100644
--- a/bootstrap.datepicker/bootstrap.datepicker.d.ts
+++ b/bootstrap.datepicker/bootstrap.datepicker.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for bootstrap.datepicker
+// Type definitions for bootstrap.datepicker
// Project: https://github.com/eternicode/bootstrap-datepicker
// Definitions by: Boris Yankov
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -24,4 +24,10 @@ interface JQuery {
datepicker(methodName: string): JQuery;
datepicker(methodName: string, params: any): JQuery;
datepicker(options: DatepickerOptions): JQuery;
-}
\ No newline at end of file
+
+ off(events?: "changeDate", selector?: any, handler?: (eventObject: any) => any): JQuery;
+
+ on(events: "changeDate", selector?: string, data?: any, handler?: (eventObject: any) => any): JQuery;
+ on(events: "changeDate", selector?: string, handler?: (eventObject: any) => any): JQuery;
+ on(events: "changeDate", handler?: (eventObject: any) => any): JQuery;
+}
diff --git a/bootstrap.paginator/bootstrap.paginator.d.ts.tscparams b/bootstrap.paginator/bootstrap.paginator.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/bootstrap.paginator/bootstrap.paginator.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/bootstrap/bootstrap-tests.ts.tscparams b/bootstrap/bootstrap-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/bootstrap/bootstrap-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/box2d/box2dweb-test.ts.tscparams b/box2d/box2dweb-test.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/box2d/box2dweb-test.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/box2d/box2dweb.d.ts.tscparams b/box2d/box2dweb.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/box2d/box2dweb.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/breeze/breeze-1.0-tests.ts.tscparams b/breeze/breeze-1.0-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/breeze/breeze-1.0-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/breeze/breeze-1.0.d.ts.tscparams b/breeze/breeze-1.0.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/breeze/breeze-1.0.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/breeze/breeze-1.2-tests.ts.tscparams b/breeze/breeze-1.2-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/breeze/breeze-1.2-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/breeze/breeze-1.2.d.ts.tscparams b/breeze/breeze-1.2.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/breeze/breeze-1.2.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/breeze/breeze-tests.ts.tscparams b/breeze/breeze-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/breeze/breeze-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/breeze/breeze.d.ts.tscparams b/breeze/breeze.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/breeze/breeze.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/browser-harness/browser-harness-tests.ts.tscparams b/browser-harness/browser-harness-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/browser-harness/browser-harness-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/browser-harness/browser-harness.d.ts b/browser-harness/browser-harness.d.ts
index 3b8cf08be8..8c410b94a3 100644
--- a/browser-harness/browser-harness.d.ts
+++ b/browser-harness/browser-harness.d.ts
@@ -9,25 +9,25 @@ declare module "browser-harness" {
import events = require("events");
interface HarnessEvents extends events.NodeEventEmitter {
- once(event: string, listener: (driver: Driver) => void);
- once(event: 'ready', listener: (driver: Driver) => void);
+ once(event: string, listener: (driver: Driver) => void): events.NodeEventEmitter;
+ once(event: 'ready', listener: (driver: Driver) => void): events.NodeEventEmitter;
- on(event: string, listener: (driver: Driver) => void);
- on(event: 'ready', listener: (driver: Driver) => void);
+ on(event: string, listener: (driver: Driver) => void): events.NodeEventEmitter;
+ on(event: 'ready', listener: (driver: Driver) => void): events.NodeEventEmitter;
}
interface DriverEvents extends events.NodeEventEmitter {
- once(event: string, listener: (text: string) => void);
- once(event: 'console.log', listener: (text: string) => void);
- once(event: 'console.warn', listener: (text: string) => void);
- once(event: 'console.error', listener: (text: string) => void);
- once(event: 'window.onerror', listener: (text: string) => void);
+ once(event: string, listener: (text: string) => void): events.NodeEventEmitter;
+ once(event: 'console.log', listener: (text: string) => void): events.NodeEventEmitter;
+ once(event: 'console.warn', listener: (text: string) => void): events.NodeEventEmitter;
+ once(event: 'console.error', listener: (text: string) => void): events.NodeEventEmitter;
+ once(event: 'window.onerror', listener: (text: string) => void): events.NodeEventEmitter;
- on(event: string, listener: (text: string) => void);
- on(event: 'console.log', listener: (text: string) => void);
- on(event: 'console.warn', listener: (text: string) => void);
- on(event: 'console.error', listener: (text: string) => void);
- on(event: 'window.onerror', listener: (text: string) => void);
+ on(event: string, listener: (text: string) => void): events.NodeEventEmitter;
+ on(event: 'console.log', listener: (text: string) => void): events.NodeEventEmitter;
+ on(event: 'console.warn', listener: (text: string) => void): events.NodeEventEmitter;
+ on(event: 'console.error', listener: (text: string) => void): events.NodeEventEmitter;
+ on(event: 'window.onerror', listener: (text: string) => void): events.NodeEventEmitter;
}
export interface Driver {
diff --git a/browser-harness/browser-harness.d.ts.tscparams b/browser-harness/browser-harness.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/browser-harness/browser-harness.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/browserify/browserify-tests.ts.tscparams b/browserify/browserify-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/browserify/browserify-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/browserify/browserify.d.ts.tscparams b/browserify/browserify.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/browserify/browserify.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/camljs/camljs-tests.ts.tscparams b/camljs/camljs-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/camljs/camljs-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/camljs/camljs.d.ts.tscparams b/camljs/camljs.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/camljs/camljs.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/casperjs/casperjs.d.ts.tscparams b/casperjs/casperjs.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/casperjs/casperjs.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/chai-fuzzy/chai-fuzzy-assert.d.ts.tscparams b/chai-fuzzy/chai-fuzzy-assert.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/chai-fuzzy/chai-fuzzy-assert.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/chai-jquery/chai-jquery-tests.ts.tscparams b/chai-jquery/chai-jquery-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/chai-jquery/chai-jquery-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/chai-jquery/chai-jquery.d.ts.tscparams b/chai-jquery/chai-jquery.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/chai-jquery/chai-jquery.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/chai/chai-assert-tests.ts.tscparams b/chai/chai-assert-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/chai/chai-assert-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/chai/chai-assert.d.ts b/chai/chai-assert.d.ts
index 7cd5e3d48b..b8845bc6b8 100644
--- a/chai/chai-assert.d.ts
+++ b/chai/chai-assert.d.ts
@@ -7,108 +7,108 @@ declare module chai
{
interface Assert
{
- (express:any, msg?:string);
+ (express:any, msg?:string):void;
- fail(actual?:any, expected?:any, msg?:string, operator?:string);
+ fail(actual?:any, expected?:any, msg?:string, operator?:string):void;
- ok(val:any, msg?:string);
- notOk(val:any, msg?:string);
+ ok(val:any, msg?:string):void;
+ notOk(val:any, msg?:string):void;
- equal(act:any, exp:any, msg?:string);
- notEqual(act:any, exp:any, msg?:string);
+ equal(act:any, exp:any, msg?:string):void;
+ notEqual(act:any, exp:any, msg?:string):void;
- strictEqual(act:any, exp:any, msg?:string);
- notStrictEqual(act:any, exp:any, msg?:string);
+ strictEqual(act:any, exp:any, msg?:string):void;
+ notStrictEqual(act:any, exp:any, msg?:string):void;
- deepEqual(act:any, exp:any, msg?:string);
- notDeepEqual(act:any, exp:any, msg?:string);
+ deepEqual(act:any, exp:any, msg?:string):void;
+ notDeepEqual(act:any, exp:any, msg?:string):void;
- isTrue(val:any, msg?:string);
- isFalse(val:any, msg?:string);
+ isTrue(val:any, msg?:string):void;
+ isFalse(val:any, msg?:string):void;
- isNull(val:any, msg?:string);
- isNotNull(val:any, msg?:string);
+ isNull(val:any, msg?:string):void;
+ isNotNull(val:any, msg?:string):void;
- isUndefined(val:any, msg?:string);
- isDefined(val:any, msg?:string);
+ isUndefined(val:any, msg?:string):void;
+ isDefined(val:any, msg?:string):void;
- isFunction(val:any, msg?:string);
- isNotFunction(val:any, msg?:string);
+ isFunction(val:any, msg?:string):void;
+ isNotFunction(val:any, msg?:string):void;
- isObject(val:any, msg?:string);
- isNotObject(val:any, msg?:string);
+ isObject(val:any, msg?:string):void;
+ isNotObject(val:any, msg?:string):void;
- isArray(val:any, msg?:string);
- isNotArray(val:any, msg?:string);
+ isArray(val:any, msg?:string):void;
+ isNotArray(val:any, msg?:string):void;
- isString(val:any, msg?:string);
- isNotString(val:any, msg?:string);
+ isString(val:any, msg?:string):void;
+ isNotString(val:any, msg?:string):void;
- isNumber(val:any, msg?:string);
- isNotNumber(val:any, msg?:string);
+ isNumber(val:any, msg?:string):void;
+ isNotNumber(val:any, msg?:string):void;
- isBoolean(val:any, msg?:string);
- isNotBoolean(val:any, msg?:string);
+ isBoolean(val:any, msg?:string):void;
+ isNotBoolean(val:any, msg?:string):void;
- typeOf(val:any, type:string, msg?:string);
- notTypeOf(val:any, type:string, msg?:string);
+ typeOf(val:any, type:string, msg?:string):void;
+ notTypeOf(val:any, type:string, msg?:string):void;
- instanceOf(val:any, type:Function, msg?:string);
- notInstanceOf(val:any, type:Function, msg?:string);
+ instanceOf(val:any, type:Function, msg?:string):void;
+ notInstanceOf(val:any, type:Function, msg?:string):void;
- include(exp:string, inc:any, msg?:string);
- include(exp:any[], inc:any, msg?:string);
+ include(exp:string, inc:any, msg?:string):void;
+ include(exp:any[], inc:any, msg?:string):void;
- notInclude(exp:string, inc:any, msg?:string);
- notInclude(exp:any[], inc:any, msg?:string);
+ notInclude(exp:string, inc:any, msg?:string):void;
+ notInclude(exp:any[], inc:any, msg?:string):void;
- match(exp:any, re:RegExp, msg?:string);
- notMatch(exp:any, re:RegExp, msg?:string);
+ match(exp:any, re:RegExp, msg?:string):void;
+ notMatch(exp:any, re:RegExp, msg?:string):void;
- property(obj:Object, prop:string, msg?:string);
- notProperty(obj:Object, prop:string, msg?:string);
- deepProperty(obj:Object, prop:string, msg?:string);
- notDeepProperty(obj:Object, prop:string, msg?:string);
+ property(obj:Object, prop:string, msg?:string):void;
+ notProperty(obj:Object, prop:string, msg?:string):void;
+ deepProperty(obj:Object, prop:string, msg?:string):void;
+ notDeepProperty(obj:Object, prop:string, msg?:string):void;
- propertyVal(obj:Object, prop:string, val:any, msg?:string);
- propertyNotVal(obj:Object, prop:string, val:any, msg?:string);
+ propertyVal(obj:Object, prop:string, val:any, msg?:string):void;
+ propertyNotVal(obj:Object, prop:string, val:any, msg?:string):void;
- deepPropertyVal(obj:Object, prop:string, val:any, msg?:string);
- deepPropertyNotVal(obj:Object, prop:string, val:any, msg?:string);
+ deepPropertyVal(obj:Object, prop:string, val:any, msg?:string):void;
+ deepPropertyNotVal(obj:Object, prop:string, val:any, msg?:string):void;
- lengthOf(exp:any, len:number, msg?:string);
+ lengthOf(exp:any, len:number, msg?:string):void;
//alias frenzy
- throw(fn:Function, msg?:string);
- throw(fn:Function, regExp:RegExp);
- throw(fn:Function, errType:Function, msg?:string);
- throw(fn:Function, errType:Function, regExp:RegExp);
+ throw(fn:Function, msg?:string):void;
+ throw(fn:Function, regExp:RegExp):void;
+ throw(fn:Function, errType:Function, msg?:string):void;
+ throw(fn:Function, errType:Function, regExp:RegExp):void;
- throws(fn:Function, msg?:string);
- throws(fn:Function, regExp:RegExp);
- throws(fn:Function, errType:Function, msg?:string);
- throws(fn:Function, errType:Function, regExp:RegExp);
+ throws(fn:Function, msg?:string):void;
+ throws(fn:Function, regExp:RegExp):void;
+ throws(fn:Function, errType:Function, msg?:string):void;
+ throws(fn:Function, errType:Function, regExp:RegExp):void;
- Throw(fn:Function, msg?:string);
- Throw(fn:Function, regExp:RegExp);
- Throw(fn:Function, errType:Function, msg?:string);
- Throw(fn:Function, errType:Function, regExp:RegExp);
+ Throw(fn:Function, msg?:string):void;
+ Throw(fn:Function, regExp:RegExp):void;
+ Throw(fn:Function, errType:Function, msg?:string):void;
+ Throw(fn:Function, errType:Function, regExp:RegExp):void;
- doesNotThrow(fn:Function, msg?:string);
- doesNotThrow(fn:Function, regExp:RegExp);
- doesNotThrow(fn:Function, errType:Function, msg?:string);
- doesNotThrow(fn:Function, errType:Function, regExp:RegExp);
+ doesNotThrow(fn:Function, msg?:string):void;
+ doesNotThrow(fn:Function, regExp:RegExp):void;
+ doesNotThrow(fn:Function, errType:Function, msg?:string):void;
+ doesNotThrow(fn:Function, errType:Function, regExp:RegExp):void;
- operator(val:any, operator:string, val2:any, msg?:string);
- closeTo(act:number, exp:number, delta:number, msg?:string);
+ operator(val:any, operator:string, val2:any, msg?:string):void;
+ closeTo(act:number, exp:number, delta:number, msg?:string):void;
- sameMembers(set1:any[], set2:any[], msg?:string);
- includeMembers(set1:any[], set2:any[], msg?:string);
+ sameMembers(set1:any[], set2:any[], msg?:string):void;
+ includeMembers(set1:any[], set2:any[], msg?:string):void;
- ifError(val:any, msg?:string);
+ ifError(val:any, msg?:string):void;
}
//node module
var assert:Assert;
}
//browser global
-declare var assert:chai.Assert;
\ No newline at end of file
+declare var assert:chai.Assert;
diff --git a/chai/chai-tests.ts b/chai/chai-tests.ts
index 8a09c3f420..b559c515da 100644
--- a/chai/chai-tests.ts
+++ b/chai/chai-tests.ts
@@ -688,6 +688,12 @@ function _throw() {
}, "blah: expected [Function] to throw error including 'hello' but got 'testing'");
}
+function use(){
+ chai.use(function (_chai, utils) {
+ _chai.can.use.any();
+ });
+}
+
function respondTo() {
function Foo() {};
var bar = {};
diff --git a/chai/chai-tests.ts.tscparams b/chai/chai-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/chai/chai-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/chai/chai.d.ts b/chai/chai.d.ts
index 9d649a17c5..9fc93a6670 100644
--- a/chai/chai.d.ts
+++ b/chai/chai.d.ts
@@ -8,6 +8,9 @@ declare module chai {
function expect(target: any): Expect;
+ // Provides a way to extend the internals of Chai
+ function use(fn: (chai: any, utils: any) => void);
+
interface ExpectStatic {
(target: any): Expect;
}
diff --git a/chai/chai.d.ts.tscparams b/chai/chai.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/chai/chai.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/cheerio/cheerio-tests.ts.tscparams b/cheerio/cheerio-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/cheerio/cheerio-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/cheerio/cheerio.d.ts.tscparams b/cheerio/cheerio.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/cheerio/cheerio.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/chrome/chrome-app-tests.ts b/chrome/chrome-app-tests.ts
new file mode 100644
index 0000000000..0ae0ae2af4
--- /dev/null
+++ b/chrome/chrome-app-tests.ts
@@ -0,0 +1,27 @@
+///
+
+import runtime = chrome.app.runtime;
+import cwindow = chrome.app.window;
+
+var createOptions: cwindow.CreateOptions = {
+ id: "My Window",
+ bounds: {
+ left: 0,
+ top: 0,
+ width: 640,
+ height: 480
+ },
+ resizable: true
+};
+
+//Create new window on app launch
+chrome.app.runtime.onLaunched.addListener(function (launchData: runtime.LaunchData) {
+ chrome.app.window.create('app/url', createOptions, function (created_window: cwindow.AppWindow) {
+ return;
+ });
+});
+
+chrome.app.runtime.onRestarted.addListener(function () { return; });
+
+// Get Current Window
+var currentWindow: cwindow.AppWindow = chrome.app.window.current();
\ No newline at end of file
diff --git a/chrome/chrome-app-tests.ts.tscparams b/chrome/chrome-app-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/chrome/chrome-app-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/chrome/chrome-app.d.ts b/chrome/chrome-app.d.ts
new file mode 100644
index 0000000000..c8dd2e6d46
--- /dev/null
+++ b/chrome/chrome-app.d.ts
@@ -0,0 +1,95 @@
+// Type definitions for Chrome packaged application development.
+// Project: http://developer.chrome.com/apps/
+// Definitions by: Adam Lay
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+////////////////////
+// App Runtime
+////////////////////
+declare module chrome.app.runtime {
+ interface LaunchData {
+ id?: string;
+ items?: LaunchDataItem[];
+ url?: string;
+ referrerUrl?: string;
+ isKioskSession?: boolean;
+ }
+
+ interface LaunchDataItem {
+ entry: File;
+ type: string;
+ }
+
+ interface LaunchedEvent {
+ addListener(callback: (launchData: LaunchData) => void);
+ }
+
+ interface RestartedEvent {
+ addListener(callback: () => void);
+ }
+
+ var onLaunched: LaunchedEvent;
+ var onRestarted: RestartedEvent;
+}
+
+////////////////////
+// App Window
+////////////////////
+declare module chrome.app.window {
+ interface Bounds {
+ left?: number;
+ top?: number;
+ width?: number;
+ height?: number;
+ }
+
+ interface AppWindow {
+ focus: () => void;
+ fullscreen: () => void;
+ isFullscreen: () => boolean;
+ minimize: () => void;
+ isMinimized: () => boolean;
+ maximize: () => void;
+ isMaximized: () => boolean;
+ restore: () => void;
+ moveTo: (left: number, top: number) => void;
+ resizeTo: (width: number, height: number) => void;
+ drawAttention: () => void;
+ clearAttention: () => void;
+ close: () => void;
+ show: () => void;
+ hide: () => void;
+ getBounds: () => Bounds;
+ setBounds: (bounds: Bounds) => void;
+ contentWindow: Window;
+ }
+
+ interface CreateOptions {
+ id?: string;
+ minWidth?: number;
+ minHeight?: number;
+ maxWidth?: number;
+ maxHeight?: number;
+ frame?: string; // "none", "chrome"
+ bounds?: Bounds;
+ transparentBackground?: boolean;
+ state?: string; // "normal", "fullscreen", "maximized", "minimized"
+ hidden?: boolean;
+ resizable?: boolean;
+ singleton?: boolean;
+ }
+
+ export function create(url: string, options?: CreateOptions, callback?: (created_window: AppWindow) => void): void;
+ export function current(): AppWindow;
+
+ interface WindowEvent {
+ addListener(callback: () => void): void;
+ }
+
+ var onBoundsChanged: WindowEvent;
+ var onClosed: WindowEvent;
+ var onFullscreened: WindowEvent;
+ var onMaximized: WindowEvent;
+ var onMinimized: WindowEvent;
+ var onRestored: WindowEvent;
+}
\ No newline at end of file
diff --git a/chrome/chrome-app.d.ts.tscparams b/chrome/chrome-app.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/chrome/chrome-app.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/chrome/chrome-tests.ts.tscparams b/chrome/chrome-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/chrome/chrome-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts
index 3a01db6c1c..8b77c9617a 100644
--- a/chrome/chrome.d.ts
+++ b/chrome/chrome.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Chrome extension development.
+// Type definitions for Chrome extension development.
// Project: http://developer.chrome.com/extensions/
// Definitions by: Matthew Kimber
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -114,7 +114,7 @@ declare module chrome.bookmarks {
export function getSubTree(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
export function removeTree(id: string, callback?: Function): void;
- var onRemoved: chrome.alarms.AlarmEvent;
+ var onRemoved: BookmarkRemovedEvent;
var onImportEnded: BookmarkImportEndedEvent;
var onImportBegan: BookmarkImportBeganEvent;
var onChanged: BookmarkChangedEvent;
@@ -1056,6 +1056,15 @@ declare module chrome.history {
var onVisitRemoved: HistoryVisitRemovedEvent;
}
+
+////////////////////
+// Identity
+////////////////////
+declare module chrome.identity {
+ var getAuthToken: (options:any, cb:(token:{})=>void)=>void;
+}
+
+
////////////////////
// Internationalization
////////////////////
@@ -1341,7 +1350,7 @@ declare module chrome.pageCapture {
tabId: number;
}
- export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: any) => void): void;
+ export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData: any) => void): void;
}
////////////////////
@@ -1472,6 +1481,9 @@ declare module chrome.runtime {
interface RuntimeSuspendCanceledEvent extends chrome.events.Event {
addListener(callback: Function): void;
}
+ interface RuntimeMessageEvent extends chrome.events.Event {
+ addListener(callback: Function): void;
+ }
export function getBackgroundPage(callback: (backgroundPage?: Window) => void): void;
export function getManifest(): Object;
@@ -1481,6 +1493,10 @@ declare module chrome.runtime {
var onStartup: RuntimeStartupEvent;
var onInstalled: RuntimeInstalledEvent;
var onSuspendCanceled: RuntimeSuspendCanceledEvent;
+ var onMessage: RuntimeMessageEvent;
+ var onMessageExternal: RuntimeMessageEvent;
+ var sendMessage:(req:any, cb:(resp:any)=>void)=>void;
+
}
////////////////////
diff --git a/chrome/chrome.d.ts.tscparams b/chrome/chrome.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/chrome/chrome.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/codemirror/codemirror-tests.ts.tscparams b/codemirror/codemirror-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/codemirror/codemirror-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/codemirror/codemirror.d.ts.tscparams b/codemirror/codemirror.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/codemirror/codemirror.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/cometd/cometd.d.ts b/cometd/cometd.d.ts
new file mode 100644
index 0000000000..6002fffb06
--- /dev/null
+++ b/cometd/cometd.d.ts
@@ -0,0 +1,28 @@
+// Type definitions for CometD 2.5.1
+// Project: http://cometd.org
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+declare module CometD {
+
+ var onListenerException: (exception: any, subscriptionHandle: any, isListener: boolean, message: string) => void;
+
+ function init(options: ConfigurationOptions): void;
+
+ function addListener(channel: string, listener: (message: any) => void): void;
+ function removeListener(listener: (message: any) => void): void;
+
+ function publish(channel: string, message: any): void;
+
+ interface ConfigurationOptions {
+ url: string;
+ logLevel?: string;
+ maxConnections?: number;
+ backoffIncrement?: number;
+ maxBackoff?: number;
+ reverseIncomingExtensions?: boolean;
+ maxNetworkDelay?: number;
+ requestHeaders?: any;
+ appendMessageTypeToURL?: boolean;
+ autoBatch?: boolean;
+ }
+}
diff --git a/commander/commander-tests.ts.tscparams b/commander/commander-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/commander/commander-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/convert-source-map/convert-source-map-tests.ts.tscparams b/convert-source-map/convert-source-map-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/convert-source-map/convert-source-map-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/convert-source-map/convert-source-map.d.ts.tscparams b/convert-source-map/convert-source-map.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/convert-source-map/convert-source-map.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/crossroads/crossroads-tests.ts.tscparams b/crossroads/crossroads-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/crossroads/crossroads-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/crossroads/crossroads.d.ts.tscparams b/crossroads/crossroads.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/crossroads/crossroads.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/d3/d3-tests.ts.tscparams b/d3/d3-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/d3/d3-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/d3/d3.d.ts b/d3/d3.d.ts
index 48eb0ede93..e97e12bf53 100644
--- a/d3/d3.d.ts
+++ b/d3/d3.d.ts
@@ -312,7 +312,7 @@ declare module D3 {
};
/**
* Request an XML document fragment.
- *
+ *
* @param url Url to request
* @param callback Function to invoke when resource is loaded or the request fails
*/
@@ -563,7 +563,7 @@ declare module D3 {
(): string;
/**
* Set the MIME Type for the request
- *
+ *
* @param type The MIME type for the request
*/
(type: string): Xhr;
@@ -578,7 +578,7 @@ declare module D3 {
(): (xhr: XMLHttpRequest) => any;
/**
* Set function used to map the response to the associated data value
- *
+ *
* @param value The function used to map the response to a data value
*/
(value: (xhr: XMLHttpRequest) => any): Xhr;
@@ -643,7 +643,7 @@ declare module D3 {
export interface Dsv {
/**
* Request a delimited values file
- *
+ *
* @param url Url to request
* @param callback Function to invoke when resource is loaded or the request fails
*/
@@ -656,7 +656,7 @@ declare module D3 {
parse(string: string): any[];
/**
* Parse a delimited string into tuples, ignoring the header row.
- *
+ *
* @param string delimited formatted string to parse
*/
parseRows(string: string, accessor: (row: any[], index: number) => any): any;
@@ -709,6 +709,7 @@ declare module D3 {
append: (name: string) => Selection;
insert: (name: string, before: string) => Selection;
remove: () => Selection;
+ empty: () => boolean;
data: {
(values: (data: any, index?: number) => any[], key?: (data: any, index?: number) => string): UpdateSelection;
@@ -718,6 +719,7 @@ declare module D3 {
datum: {
(values: (data: any, index: number) => any): UpdateSelection;
(values: any): UpdateSelection;
+ () : any;
};
filter: {
@@ -1048,15 +1050,15 @@ declare module D3 {
(seperation: (a: GraphNode, b: GraphNode) => number): TreeLayout;
};
/**
- * Gets or sets the available layout size
+ * Gets or sets the available layout size
*/
size: {
/**
- * Gets the available layout size
+ * Gets the available layout size
*/
(): Array;
/**
- * Sets the available layout size
+ * Sets the available layout size
*/
(size: Array): TreeLayout;
};
@@ -1335,7 +1337,7 @@ declare module D3 {
(size: Array): PackLayout;
}
}
-
+
export interface TreeMapLayout {
sort: {
(): (a: GraphNode, b: GraphNode) => number;
@@ -1392,6 +1394,18 @@ declare module D3 {
}
export interface RGBColor extends Color{
+ /**
+ * the red color channel.
+ */
+ r: number;
+ /**
+ * the greeb color channel.
+ */
+ g: number;
+ /**
+ * the blue color channel.
+ */
+ b: number;
/**
* convert from RGB to HSL.
*/
@@ -2011,7 +2025,7 @@ declare module D3 {
(defined: (data: any) => any): Area;
};
}
-
+
export interface AreaRadial {
/**
* Generate a piecewise linear area, as in an area chart.
@@ -2876,15 +2890,15 @@ declare module D3 {
*/
stream(object: GeoJSON, listener: any): Stream;
/**
- *
+ *
*/
graticule(): Graticule;
/**
- *
+ *
*/
greatArc: GreatArc;
/**
- *
+ *
*/
rotation(rotation: Array): Rotation;
}
diff --git a/d3/d3.d.ts.tscparams b/d3/d3.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/d3/d3.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/d3/plugins/d3.superformula-tests.ts.tscparams b/d3/plugins/d3.superformula-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/d3/plugins/d3.superformula-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/d3/plugins/d3.superformula.d.ts.tscparams b/d3/plugins/d3.superformula.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/d3/plugins/d3.superformula.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/dhtmlxgantt/dhtmlxgantt-test.ts b/dhtmlxgantt/dhtmlxgantt-test.ts
new file mode 100644
index 0000000000..0b491ce2bc
--- /dev/null
+++ b/dhtmlxgantt/dhtmlxgantt-test.ts
@@ -0,0 +1,33 @@
+///
+
+//date operations
+var start: Date = gantt.date.week_start(new Date());
+var next: Date = gantt.date.add(new Date(), 1, "week");
+
+//hotkeys
+gantt.keys.edit_cancel = 13;
+
+//config options
+gantt.config.details_on_create = true;
+gantt.config.scale_height = 40;
+gantt.config.xml_date = "%m-%d-%Y";
+
+//templates
+gantt.templates.task_class = function (start: Date, end: Date, task: any) {
+ if (task.some)
+ return "classA";
+ else
+ return "classB";
+}
+
+//locale
+gantt.locale.labels.new_task = "New task";
+
+//API
+gantt.init("scheduler_here", start);
+gantt.load("/data/events");
+
+//events
+gantt.attachEvent("onBeforeLightbox", function (id: string) {
+ gantt.showTask(id);
+});
\ No newline at end of file
diff --git a/dhtmlxgantt/dhtmlxgantt-test.ts.tscparams b/dhtmlxgantt/dhtmlxgantt-test.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/dhtmlxgantt/dhtmlxgantt-test.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/dhtmlxgantt/dhtmlxgantt.d.ts b/dhtmlxgantt/dhtmlxgantt.d.ts
new file mode 100644
index 0000000000..fbdba35432
--- /dev/null
+++ b/dhtmlxgantt/dhtmlxgantt.d.ts
@@ -0,0 +1,989 @@
+// Type definitions for dhtmlxGantt 2.0
+// Project: http://dhtmlx.com/docs/products/dhtmlxGantt
+// Definitions by: Maksim Kozhukh
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+interface GanttTemplates{
+ /**
+ * specifies the format of dates that are set by means of API methods. Used to parse incoming dates
+ * @param date the date which needs formatting
+ */
+ api_date(date: Date): string;
+
+ /**
+ * specifies the format of dates in the "Start time" column
+ * @param date the date which needs formatting
+ */
+ date_grid(date: Date): string;
+
+ /**
+ * specifies the date format of the time scale (X-Axis)
+ * @param date the date which needs formatting
+ */
+ date_scale(date: Date): string;
+
+ /**
+ * specifies the text of tooltips that are displayed when the user creates a new dependency link
+ * @param from the id of the source task
+ * @param from_start true, if the link is being dragged from the start of the source task, false - if from the end of the task
+ * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet)
+ * @param to_start true, if the link is being dragged to the start of the target task, false - if to the end of the task
+ */
+ drag_link(from: any, from_start: boolean, to: any, to_start: boolean): string;
+
+ /**
+ * specifies the CSS class that will be applied to the link receiver (pop-up circle near the task bar)
+ * @param from the id of the source task
+ * @param from_start true, if the link is being dragged from the start of the source task, false - if from the end of the task
+ * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet)
+ * @param to_start true, if the link is being dragged to the start of the target task, false - if to the end of the task
+ */
+ drag_link_class(from: any, from_start: boolean, to: any, to_start: boolean): string;
+
+ /**
+ * specifies the custom content inserted before the labels of child items in the tree column
+ * @param task the task object
+ */
+ grid_blank(task: any): string;
+
+ /**
+ * specifies the icon of child items in the tree column
+ * @param task the task object
+ */
+ grid_file(task: any): string;
+
+ /**
+ * specifies the icon of parent items in the tree column
+ * @param task the task object
+ */
+ grid_folder(task: any): string;
+
+ /**
+ * specifies the CSS class that will be applied to the headers of the table's columns
+ * @param column the column's configuration object
+ * @param config the column's id ('name' attribute)
+ */
+ grid_header_class(column: any, config: string): string;
+
+ /**
+ * specifies the indent of the child items in a branch (in the tree column)
+ * @param task the task object
+ */
+ grid_indent(task: any): string;
+
+ /**
+ * specifies the icon of the open/close sign in the tree column
+ * @param task the task object
+ */
+ grid_open(task: any): string;
+
+ /**
+ * specifies the CSS class that will be applied to a grid row
+ * @param start the date when a task is scheduled to begin
+ * @param end the date when a task is scheduled to be completed
+ * @param task the task object
+ */
+ grid_row_class(start: Date, end: Date, task: any): string;
+
+ /**
+ * specifies the CSS class that will be applied to a link
+ * @param link the link object
+ */
+ link_class(link: any): string;
+
+ /**
+ * specifies the text in the header of the link's "delete" confirm window
+ * @param link the link object
+ */
+ link_description(link: any): string;
+
+ /**
+ * specifies the text in the completed part of the task bar
+ * @param start the date when a task is scheduled to begin
+ * @param end the date when a task is scheduled to be completed
+ * @param task the task object
+ */
+ progress_text(start: Date, end: Date, task: any): string;
+
+ /**
+ * specifies the content of the pop-up edit form
+ * @param start the date when a task is scheduled to begin
+ * @param end the date when a task is scheduled to be completed
+ * @param task the task object
+ */
+ quick_info_content(start: Date, end: Date, task: any): string;
+
+ /**
+ * specifies the date of the pop-up edit form
+ * @param start the date when a task is scheduled to begin
+ * @param end the date when a task is scheduled to be completed
+ * @param task the task object
+ */
+ quick_info_date(start: Date, end: Date, task: any): string;
+
+ /**
+ * specifies the title of the pop-up edit form
+ * @param start the date when a task is scheduled to begin
+ * @param end the date when a task is scheduled to be completed
+ * @param task the task object
+ */
+ quick_info_title(start: Date, end: Date, task: any): string;
+
+ /**
+ * specifies the CSS class that will be applied to the time scale of the timeline area
+ * @param date the date of a cell
+ */
+ scale_cell_class(date: Date): string;
+
+ /**
+ * specifies the CSS class that will be applied to the cells of the timeline area
+ * @param item the task object assigned to the row
+ * @param date the date of a cell
+ */
+ task_cell_class(item: Date, date: Date): string;
+
+ /**
+ * specifies the CSS class that will be applied to task bars
+ * @param start the date when a task is scheduled to begin
+ * @param end the date when a task is scheduled to be completed
+ * @param task the task object
+ */
+ task_class(start: Date, end: Date, task: any): string;
+
+ /**
+ * specifies the date format of the label in the 'Time period' section of the lightbox
+ * @param date the date which needs formatting
+ */
+ task_date(date: Date): string;
+
+ /**
+ * specifies the CSS class that will be applied to the row of the timeline area
+ * @param start the date when a task is scheduled to begin
+ * @param end the date when a task is scheduled to be completed
+ * @param task the task object
+ */
+ task_row_class(start: Date, end: Date, task: any): string;
+
+ /**
+ * specifies the text in the task bars and the header of the lightbox
+ * @param start the date when a task is scheduled to begin
+ * @param end the date when a task is scheduled to be completed
+ * @param task the task object
+ */
+ task_text(start: Date, end: Date, task: any): string;
+
+ /**
+ * specifies the date period in the header of the lightbox
+ * @param start the date when a task is scheduled to begin
+ * @param end the date when a task is scheduled to be completed
+ * @param task the task object
+ */
+ task_time(start: Date, end: Date, task: any): string;
+
+ /**
+ * specifies the format of the drop-down time selector in the lightbox
+ * @param date the date which needs formatting
+ */
+ time_picker(date: Date): string;
+
+ /**
+ * specifies the format of start and end dates displayed in the tooltip
+ * @param date the date which needs formatting
+ */
+ tooltip_date_format(date: Date): string;
+
+ /**
+ * specifies the text of tooltips
+ * @param start the date when a task is scheduled to begin
+ * @param end the date when a task is scheduled to be completed
+ * @param task the task object
+ */
+ tooltip_text(start: Date, end: Date, task: any): string;
+
+ /**
+ * a string from an XML file is converted into a date object in conformity with this template
+ * @param date the date which needs formatting
+ */
+ xml_date(date: Date): string;
+
+ /**
+ * a date object is converted into a string in conformity with this template. Used to send data back to the server
+ * @param date the date which needs formatting
+ */
+ xml_format(date: Date): string;
+
+ /**
+ * specifies the text assigned to tasks bars on the right side
+ * @param start the date when a task is scheduled to begin
+ * @param end the date when a task is scheduled to be completed
+ * @param task the task object
+ */
+ rightside_text(start: Date, end: Date, task: any): string;
+
+ /**
+ * specifies the text assigned to tasks bars on the left side
+ * @param start the date when a task is scheduled to begin
+ * @param end the date when a task is scheduled to be completed
+ * @param task the task object
+ */
+ leftside_text(start: Date, end: Date, task: any): string;
+}
+
+interface GanttConfigOptions{
+ /**
+ * sets the date format that will be used by the addTask() method to
+parse the start_date, end_date properties in case they are specified as strings
+ */
+ api_date: string;
+
+ /**
+ * enables automatic adjusting of the grid's columns to the grid's width
+ */
+ autofit: boolean;
+
+ /**
+ * stores a collection of buttons resided in the left bottom corner of the lightbox
+ */
+ buttons_left: any;
+
+ /**
+ * stores a collection of buttons resided in the right bottom corner of the lightbox
+ */
+ buttons_right: any;
+
+ /**
+ * configures the columns of the table
+ */
+ columns: any;
+
+ /**
+ * sets the format of dates in the "Start time" column of the table
+ */
+ date_grid: string;
+
+ /**
+ * sets the format of the time scale (X-Axis)
+ */
+ date_scale: string;
+
+ /**
+ * 'says' to open the lightbox while creating new events by clicking on the '+' button
+ */
+ details_on_create: boolean;
+
+ /**
+ * 'says' to open the lightbox after double clicking on a task
+ */
+ details_on_dblclick: boolean;
+
+ /**
+ * enables the possibility to drag the lightbox by the header
+ */
+ drag_lightbox: boolean;
+
+ /**
+ * enables creating dependency links by drag-and-drop
+ */
+ drag_links: boolean;
+
+ /**
+ * stores the types of available drag-and-drop modes
+ */
+ drag_mode: any;
+
+ /**
+ * enables the possibility to move tasks by drag-and-drop
+ */
+ drag_move: boolean;
+
+ /**
+ * enables the possibility to change the task progress by dragging the progress knob
+ */
+ drag_progress: boolean;
+
+ /**
+ * enables the possibility to resize tasks by drag-and-drop
+ */
+ drag_resize: boolean;
+
+ /**
+ * sets the number of 'gantt.config.duration_unit' units that will correspond to one unit of the 'duration' data property.
+ */
+ duration_step: number;
+
+ /**
+ * sets the duration unit in milliseconds
+ */
+ duration_unit: number;
+
+ /**
+ * sets the end value of the time scale (X–Axis)
+ */
+ end_date: Date;
+
+ /**
+ * 'says' the Gantt chart to re-render the scale each time a task doesn't fit into the existing scale interval
+ */
+ fit_tasks: boolean;
+
+ /**
+ * sets the maximum width of the grid
+ */
+ grid_width: number;
+
+ /**
+ * sets whether the timeline area will be initially scrolled to display the earliest task
+ */
+ initial_scroll: boolean;
+
+ /**
+ * specifies the lightbox object
+ */
+ lightbox: any;
+
+ /**
+ * increases the height of the lightbox
+ */
+ lightbox_additional_height: number;
+
+ /**
+ * sets the size of the link arrow
+ */
+ link_arrow_size: number;
+
+ /**
+ * sets the name of the attribute that will specify the id of the link's HTML element
+ */
+ link_attribute: string;
+
+ /**
+ * sets the width of dependency links in the timeline area
+ */
+ link_line_width: number;
+
+ /**
+ * sets the width of the area (over the link) sensitive to clicks
+ */
+ link_wrapper_width: number;
+
+ /**
+ * stores the types of links dependencies
+ */
+ links: any;
+
+ /**
+ * sets the minimum width for a column
+ */
+ min_column_width: number;
+
+ /**
+ * sets the minimum step (in milliseconds) for task's time values
+ */
+ min_duration: number;
+
+ /**
+ * activates the 'branch' mode that allows dragging tasks only within the parent branch
+ */
+ order_branch: boolean;
+
+ /**
+ * defines whether the task form will appear from the left/right side of the screen or near the selected task
+ */
+ quick_info_detached: boolean;
+
+ /**
+ * stores a collection of buttons resided in the pop-up edit form
+ */
+ quickinfo_buttons: any;
+
+ /**
+ * activates the read-only mode for the Gantt chart
+ */
+ readonly: boolean;
+
+ /**
+ * enables rounding the task's start and end dates to the nearest scale marks
+ */
+ round_dnd_dates: boolean;
+
+ /**
+ * sets the default height for rows of the table
+ */
+ row_height: number;
+
+ /**
+ * sets the height of the time scale and the header of the grid
+ */
+ scale_height: number;
+
+ /**
+ * sets the unit of the time scale (X-Axis)
+ */
+ scale_unit: string;
+
+ /**
+ * enables selection of tasks in the Gantt chart
+ */
+ select_task: boolean;
+
+ /**
+ * enables converting server-side dates from UTC to a local time zone (and backward) while sending data to the server
+ */
+ server_utc: boolean;
+
+ /**
+ * enables showing a progress/spinner while data is loading
+ */
+ show_progress: boolean;
+
+ /**
+ * enables sorting in the table
+ */
+ sort: boolean;
+
+ /**
+ * sets the start value of the time scale (X–Axis)
+ */
+ start_date: Date;
+
+ /**
+ * sets the start day of weeks
+ */
+ start_on_monday: boolean;
+
+ /**
+ * sets the step of the time scale (X-Axis)
+ */
+ step: number;
+
+ /**
+ * specifies the second time scale(s)
+ */
+ subscales: any;
+
+ /**
+ * sets the name of the attribute that will specify the id of the task's HTML element
+ */
+ task_attribute: string;
+
+ /**
+ * sets the format of the date label in the 'Time period' section of the lightbox
+ */
+ task_date: string;
+
+ /**
+ * sets the height of task bars in the timeline area
+ */
+ task_height: number;
+
+ /**
+ * sets the offset (in pixels) of the nearest task from the left border in the timeline
+ */
+ task_scroll_offset: number;
+
+ /**
+ * sets the format of the time drop-down selector in the lightbox
+ */
+ time_picker: string;
+
+ /**
+ * sets the minimum step (in minutes) for the task's time values
+ */
+ time_step: number;
+
+ /**
+ * sets the timeout in milliseconds before the tooltip is displayed for a task
+ */
+ tooltip_timeout: number;
+
+ /**
+ * enables/disables the touch support for the Gantt chart
+ */
+ touch: any;
+
+ /**
+ * defines the time period in milliseconds that is used to differ the long touch gesture from the scroll gesture
+ */
+ touch_drag: any;
+
+ /**
+ * sets the date format that is used to parse data from the data set
+ */
+ xml_date: string;
+}
+
+
+interface GanttDateHelpers{
+ add(origin: Date, count: number, unit: string): Date;
+ copy(origin: Date): Date;
+
+ date_part(origin: Date): Date;
+ time_part(origin: Date): Date;
+
+ day_start(origin: Date): Date;
+ month_start(origin: Date): Date;
+ week_start(origin: Date): Date;
+ year_start(origin: Date): Date;
+
+ getISOWeek(origin: Date): number;
+ getUTCISOWeek(origin: Date): number;
+
+ date_to_str(format: string): any;
+ str_to_date(format: string): any;
+ convert_to_utc(origin: Date): Date;
+ to_fixed(value: number): string;
+}
+
+interface GanttHotkeys{
+ edit_save: number;
+ edit_cancel: number;
+}
+
+//Gantt.locale
+
+interface GanttLocaleDate{
+ month_full: string[];
+ month_short: string[];
+ day_full: string[];
+ day_short: string[];
+}
+
+interface GanttLocaleLabels{
+ new_task: string;
+ icon_save: string;
+ icon_cancel: string;
+ icon_details: string;
+ icon_edit: string;
+ icon_delete: string;
+ confirm_closing: string;
+ confirm_deleting: string;
+ section_description: string;
+ section_time: string;
+ confirm_link_deleting: string;
+ link_from: string;
+ link_to: string;
+ link_start: string;
+ link_end: string;
+ minutes: string;
+ hours: string;
+ days: string;
+ weeks: string;
+ months: string;
+ years: string;
+}
+
+interface GanttLocale{
+ date: GanttLocaleDate;
+ labels: GanttLocaleLabels;
+}
+
+interface GanttStatic{
+ templates: GanttTemplates;
+ config: GanttConfigOptions;
+ date: GanttDateHelpers;
+ keys: GanttHotkeys;
+ skin: String;
+ version: String;
+ locale: GanttLocale;
+ $click: any;
+
+ /**
+ * adds a new dependency link
+ * @param link the link object
+ */
+ addLink(link: any): any;
+
+ /**
+ * adds a new task
+ * @param task the task object
+ * @param parent the parent's id
+ */
+ addTask(task: any, parent: string): any;
+
+ /**
+ * attaches the handler to an inner event of dhtmlxGantt
+ * @param name the event's name, case-insensitive
+ * @param handler the handler function
+ */
+ attachEvent(name: string, handler: (...args: any[])=>any): any;
+
+ /**
+ * calls an inner event
+ * @param name the event's name, case-insensitive
+ * @param params an array of the event-related data
+ */
+ callEvent(name: string, params: any): boolean;
+
+ /**
+ * changes the link's id
+ * @param id the current link's id
+ * @param new_id the new link's id
+ */
+ changeLinkId(id: any, new_id: any);
+
+ /**
+ * changes the task's id
+ * @param id the current task's id
+ * @param new_id the new task's id
+ */
+ changeTaskId(id: any, new_id: any);
+
+ /**
+ * checks whether an event has some handler(s) specified
+ * @param name the event's name
+ */
+ checkEvent(name: string): boolean;
+
+ /**
+ * removes all tasks from the Gantt chart
+ */
+ clearAll();
+
+ /**
+ * closes the branch with the specified id
+ * @param id the branch id
+ */
+ close(id : any);
+
+ /**
+ * deletes the specified dependency link
+ * @param id the dependency link's id
+ */
+ deleteLink(id: any);
+
+ /**
+ * deletes the specified task
+ * @param id the task's id
+ */
+ deleteTask(id: string);
+
+ /**
+ * detaches all handlers from events (which were attached before by the attachEvent() method)
+ */
+ detachAllEvents();
+
+ /**
+ * detaches a handler from an event (which was attached before by the attachEvent() method)
+ * @param id the event's id
+ */
+ detachEvent(id: string);
+
+ /**
+ * iterates over specified tasks of the Gantt chart
+ * @param code a function that will iterate over tasks. Takes a task object as a parameter
+ * @param parent the parent id. If specified, the function will iterate over childs of the specified parent
+ * @param master the object, that 'this' will refer to
+ */
+ eachTask(code : (...args: any[])=>any, parent?: any, master?: any);
+
+ /**
+ * returns the 1st-level child tasks of the specified parent branch
+ * @param id the parent branch's id
+ */
+ getChildren(id: any): any;
+
+ /**
+ * get the index of a task in the tree
+ * @param id the task id
+ */
+ getGlobalTaskIndex(id: any);
+
+ /**
+ * gets the label of a select control in the lightbox
+ * @param property the name of a data property that the control is mapped to
+ * @param key the option's id. This parameter is compared with the task's data property to assign the select's option to the task
+ */
+ getLabel(property: string, key: any);
+
+ /**
+ * gets the lightbox's HTML object element
+ */
+ getLightbox(): HTMLElement;
+
+ /**
+ * returns the object of the lightbox's section
+ * @param name the name of the section
+ */
+ getLightboxSection(name: string): any;
+
+ /**
+ * returns values of the lightbox's sections
+ */
+ getLightboxValues(): any;
+
+ /**
+ * returns the dependency link object by the specified id
+ * @param id the link id
+ */
+ getLink(id: any): any;
+
+ /**
+ * returns the HTML element of the specified dependency link
+ * @param id the link id
+ */
+ getLinkNode(id: any): HTMLElement;
+
+ /**
+ * returns the id of the next item (no matter what the level of nesting is: the same or different)
+ * @param id the task id
+ */
+ getNext(id: any): any;
+
+ /**
+ * returns the id of the previous item (no matter what the level of nesting is: the same or different)
+ * @param id the task id
+ */
+ getPrev(id: any): any;
+
+ /**
+ * returns the scroll position
+ */
+ getScrollState(): any;
+
+ /**
+ * returns the id of the selected task
+ */
+ getSelectedId(): any;
+
+ /**
+ * gets the current state of the Gantt chart
+ */
+ getState(): any;
+
+ /**
+ * returns the task object
+ * @param id the task id
+ */
+ getTask(id: any): any;
+
+ /**
+ * returns a collection of tasks which occur during the specified period
+ * @param from the start date of the period
+ * @param to the end date of the period
+ */
+ getTaskByTime(from?: Date, to?: Date): any;
+
+ /**
+ * get the index of a task in the branch
+ * @param id the task id
+ */
+ getTaskIndex(id: any): number;
+
+ /**
+ * returns the HTML element of the task bar
+ * @param id the task id
+ */
+ getTaskNode(id: any): HTMLElement;
+
+ /**
+ * returns the HTML element of the task row in the table
+ * @param id the task id
+ */
+ getTaskRowNode(id: any): HTMLElement;
+
+ /**
+ * checks whether the specified item has child tasks
+ * @param id the task id
+ */
+ hasChild(id: any): boolean;
+
+ /**
+ * hides the lightbox modal overlay that blocks interactions with the remaining screen
+ * @param box an element to hide
+ */
+ hideCover(box?: HTMLElement);
+
+ /**
+ * closes the lightbox if it's currently active
+ */
+ hideLightbox();
+
+ /**
+ * hides the pop-up task form (if it's currently active)
+ */
+ hideQuickInfo();
+
+ /**
+ * constructor. Initializes a dhtmlxGantt object
+ * @param container an HTML container ( or its id) where a dhtmlxGantt object will be initialized
+ * @param from the start value of the time scale (X–Axis)
+ * @param to the end value of the time scale (X–Axis)
+ */
+ init(container: any, from?: Date, to?: Date);
+
+ /**
+ * checks whether the specified link is correct
+ * @param link the link object
+ */
+ isLinkAllowed(link: any): boolean;
+
+ /**
+ * checks whether the specified link exists
+ * @param id the link id
+ */
+ isLinkExists(id: any): boolean;
+
+ /**
+ * checks whether the specified task exists
+ * @param id the task id
+ */
+ isTaskExists(id: any): boolean;
+
+ /**
+ * checks whether the specifies task is currently rendered in the Gantt chart
+ * @param id the task's id
+ */
+ isTaskVisible(id: any): boolean;
+
+ /**
+ * loads data to the gantt from an external data source
+ * @param url the server-side url (may be a static file or a server side script that outputs data)
+ * @param type ('json', 'xml', 'oldxml') the data type. The default value - 'json'
+ * @param callback the callback function
+ */
+ load(url: string, type?: string, callback?: (...args: any[])=>any);
+
+ /**
+ * gets the id of a task from the specified HTML event
+ * @param e a native event
+ */
+ locate(e: Event): string;
+
+ /**
+ * moves a task to a new position
+ * @param sid the id of the task to move
+ * @param tindex the index of the position that the task will be moved to (the index in the whole tree)
+ * @param parent the parent id. If specified, the tindex will refer to the index in the 'parent' branch
+ */
+ moveTask(sid: any, tindex: number, parent?: any);
+
+ /**
+ * opens the branch with the specified id
+ * @param id the branch id
+ */
+ open(id: any);
+
+ /**
+ * loads data from a client-side resource
+ * @param url a string or object which represents data
+ * @param type ( 'json', 'xml' ) the data type. The default value - 'json'
+ */
+ parse(url: any, type?: string);
+
+ /**
+ * refreshes data in the Gantt chart
+ */
+ refreshData();
+
+ /**
+ * refreshes the specifies link
+ * @param id the link id
+ */
+ refreshLink(id: any);
+
+ /**
+ * refreshes the task and its related links
+ * @param id the task id
+ */
+ refreshTask(id: any);
+
+ /**
+ * renders the whole Gantt chart
+ */
+ render();
+
+ /**
+ * removes the current lightbox's HTML object element
+ */
+ resetLightbox();
+
+ /**
+ * forces the lightbox to resize
+ */
+ resizeLightbox();
+
+ /**
+ * scrolls the Gantt container to the specified position
+ * @param x the value of the horizontal scroll
+ * @param y the value of the vertical scroll
+ */
+ scrollTo(x: number, y: number);
+
+ /**
+ * selects the specified task
+ * @param id the task id
+ */
+ selectTask(id: any): any;
+
+ /**
+ * serializes the data into JSON or XML format.
+ * @param type the format that the data will be serialized into. Possible values: 'json' (default ), 'xml'.
+ */
+ serialize(type?: string);
+
+ /**
+ * returns a list of options
+ * @param list_name the name of a list
+ * @param options an array of options
+ */
+ serverList(list_name: string, options?: any);
+
+ /**
+ * resizes the Gantt chart
+ */
+ setSizes();
+
+ /**
+ * shows the lightbox modal overlay that blocks interactions with the remaining screen
+ * @param box an element to hide
+ */
+ showCover(box?: HTMLElement);
+
+ /**
+ * opens the lightbox for the specified task
+ * @param id the task id
+ */
+ showLightbox(id : any);
+
+ /**
+ * displays the pop-up task form for the specified task
+ * @param id the task id
+ */
+ showQuickInfo(id: any);
+
+ /**
+ * makes the specified task visible on the screen
+ * @param id the task id
+ */
+ showTask(id: any);
+
+ /**
+ * sorts the tasks in the grid
+ * @param field the name of the column that the grid will be sorted by or a custom sorting function
+ * @param desc specifies the sorting direction: true - descending sort and false - ascending sort. By default, false
+ * @param parent the id of the parent task. Specify the parameter if you want to sort tasks only in the branch of the specified parent.
+ */
+ sort(field: any, desc?: boolean, parent?: any);
+
+ /**
+ * removes selection from the selected task
+ */
+ unselectTask();
+
+ /**
+ * updates the specified dependency link
+ * @param id the task id
+ */
+ updateLink(id: string);
+
+ /**
+ * updates the specified task
+ * @param id the task id
+ */
+ updateTask(id: string);
+}
+
+
+
+declare var gantt: GanttStatic;
\ No newline at end of file
diff --git a/dhtmlxgantt/dhtmlxgantt.d.ts.tscparams b/dhtmlxgantt/dhtmlxgantt.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/dhtmlxgantt/dhtmlxgantt.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/dhtmlxscheduler/dhtmlxscheduler-test.ts b/dhtmlxscheduler/dhtmlxscheduler-test.ts
new file mode 100644
index 0000000000..d526a1eaf3
--- /dev/null
+++ b/dhtmlxscheduler/dhtmlxscheduler-test.ts
@@ -0,0 +1,33 @@
+///
+
+//date operations
+var start: Date = scheduler.date.week_start(new Date());
+var next: Date = scheduler.date.add(new Date(), 1, "week");
+
+//hotkeys
+scheduler.keys.edit_cancel = 13;
+
+//config options
+scheduler.config.details_on_create = true;
+scheduler.config.xml_date = "%m-%d-%Y";
+scheduler.xy.bar_height = 40;
+
+//templates
+scheduler.templates.event_class = function (start: Date, end: Date, event: any) {
+ if (event.some)
+ return "classA";
+ else
+ return "classB";
+}
+
+//locale
+scheduler.locale.labels.week_tab = "7 days";
+
+//API
+scheduler.init("scheduler_here", start);
+scheduler.load("/data/events");
+
+//events
+scheduler.attachEvent("onEmptyClick", function (ev: Event) {
+ var date: Date = scheduler.getActionData(ev).date;
+});
\ No newline at end of file
diff --git a/dhtmlxscheduler/dhtmlxscheduler-test.ts.tscparams b/dhtmlxscheduler/dhtmlxscheduler-test.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/dhtmlxscheduler/dhtmlxscheduler-test.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/dhtmlxscheduler/dhtmlxscheduler.d.ts b/dhtmlxscheduler/dhtmlxscheduler.d.ts
new file mode 100644
index 0000000000..011532573b
--- /dev/null
+++ b/dhtmlxscheduler/dhtmlxscheduler.d.ts
@@ -0,0 +1,1604 @@
+// Type definitions for dhtmlxScheduler 4.0
+// Project: http://dhtmlx.com/docs/products/dhtmlxScheduler
+// Definitions by: Maksim Kozhukh
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+interface SchedulerTemplates{
+ /**
+ * specifies the date in the header of the view
+ * @param start the start date of the view
+ * @param end the end date of the view
+ */
+ agenda_date(start : Date, end : Date): string;
+
+ /**
+ * specifies the text in the second column of the Agenda view
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ agenda_text(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the date in the first column of the Agenda view
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ agenda_time(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the format for dates that are set by means of API methods. Used to parse incoming dates
+ * @param date the date which needs formatting
+ */
+ api_date(date: Date): string;
+
+ /**
+ * specifies the format of the day in a cell
+ * @param date the cell date
+ */
+ calendar_date(date: Date): string;
+
+ /**
+ * specifies the date in the header of the calendar
+ * @param date the date which needs formatting
+ */
+ calendar_month(date: Date): string;
+
+ /**
+ * specifies the day name in the week sub-header of the view
+ * @param date the date which needs formatting
+ */
+ calendar_scale_date(date: Date): string;
+
+ /**
+ * specifies the date format of the lightbox start and end date inputs
+ * @param date the date which needs formatting
+ */
+ calendar_time(date: Date): string;
+
+ /**
+ * specifies the date in the header of the Day and Units views
+ * @param date the date which needs formatting
+ */
+ day_date(date: Date): string;
+
+ /**
+ * specifies the date in the sub-header of the Day view
+ * @param date the date which needs formatting
+ */
+ day_scale_date(date: Date): string;
+
+ /**
+ * specifies the date of an event. Applied to one-day events only
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ event_bar_date(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the event text. Applied to all events
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ event_bar_text(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the css style for the event container
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ event_class(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the time part of the start and end dates of the event. Mostly used by other templates for presenting time periods
+ * @param date the date which needs formatting
+ */
+ event_date(date: Date): string;
+
+ /**
+ * specifies the event header
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ event_header(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the event text
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ event_text(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the items of the Y-Axis
+ * @param date the date which needs formatting
+ */
+ hour_scale(date: Date): string;
+
+ /**
+ * specifies the format of requests in the dynamic loading mode
+ * @param date the date which needs formatting
+ */
+ load_format(date: Date): string;
+
+ /**
+ * specified the date in the header of the view
+ * @param start the start date of the view
+ * @param end the end date of the view
+ */
+ map_date(start : Date, end : Date): string;
+
+ /**
+ * specifies the text in the second column of the view
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ map_text(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the date in the first column of the view
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ map_time(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the date of the event in the Google Maps popup marker
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ marker_date(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the text of the event in the Google Maps popup marker
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ marker_text(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the date in the header of the view
+ * @param date the date which needs formatting
+ */
+ month_date(date: Date): string;
+
+ /**
+ * specifies the css class that will be applied to a day cell
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ month_date_class(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the format of the day in a cell
+ * @param date the date which needs formatting
+ */
+ month_day(date: Date): string;
+
+ /**
+ * specifies the presentation of the 'View more' link in the cell of the Month view
+ * @param date the date of a month cell
+ * @param count the number of events in the cell
+ */
+ month_events_link(date: Date, count: number): string;
+
+ /**
+ * specifies the date format of the X-Axis of the view
+ * @param date the date which needs formatting
+ */
+ month_scale_date(date: Date): string;
+
+ /**
+ * specifies the content of the pop-up edit form
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ quick_info_content(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the date of the pop-up edit form
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ quick_info_date(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the title of the pop-up edit form
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ quick_info_title(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the drop-down time selector in the lightbox
+ */
+ time_picker(): string;
+
+ /**
+ * specifies the format of start and end dates displayed in the tooltip
+ * @param date the date which needs formatting
+ */
+ tooltip_date_format(date: Date): string;
+
+ /**
+ * specifies the text of tooltips
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ tooltip_text(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the event text
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ * @param cellDate the date of a day cell that an one-day event or a single occurrence of the recurring event displayes in
+ * @param pos the position a single occurrence in the recurring event: 'start' - the first occurrence, 'end' - the last occurrence, 'middle' - for remaining occurrences
+ */
+ week_agenda_event_text(start: Date, end: Date, event: any, cellDate: Date, pos: string): string;
+
+ /**
+ * the date of a day cell of the view
+ * @param date the date which needs formatting
+ */
+ week_agenda_scale_date(date: Date): string;
+
+ /**
+ * specified the date in the header of the view
+ * @param start the start date of the view
+ * @param end the end date of the view
+ */
+ week_date(start : Date, end : Date): string;
+
+ /**
+ * specifies the css class that will be applied to a day cell
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ week_date_class(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the date in the sub-header of the view
+ * @param date the date which needs formatting
+ */
+ week_scale_date(date: Date): string;
+
+ /**
+ * a string from an XML file is converted into a date object in conformity with this template
+ * @param date the string which need to be parsed
+ */
+ xml_date(date: Date): Date;
+
+ /**
+ * a date object is converted into a string in conformity with this template. Used to send data back to the server
+ * @param date the date which needs formatting
+ */
+ xml_format(date: Date): string;
+
+ /**
+ * specifies the date in the header of the view
+ * @param date the date which needs formatting
+ */
+ year_date(date: Date): string;
+
+ /**
+ * specifies the month name in the header of a month block of the view.
+ * @param date the date which needs formatting
+ */
+ year_month(date: Date): string;
+
+ /**
+ * specifies the day name in the sub-header of a month block of the view
+ * @param date the date which needs formatting
+ */
+ year_scale_date(date: Date): string;
+
+ /**
+ * specifies the tooltip over a day cell containing some scheduled event(s)
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ year_tooltip(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the lightbox header
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ lightbox_header(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the date in the header of the view
+ * @param start the start date of the view
+ * @param end the end date of the view
+ */
+ grid_date(start : Date, end : Date): string;
+
+ /**
+ * specifies the format of dates in columns with id='date'
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param ev the event object
+ */
+ grid_full_date(start: Date, end: Date, ev: any): string;
+
+ /**
+ * specifies the format of dates in columns with id='start_date' or id='end_date'
+ * @param date the date which needs formatting
+ */
+ grid_single_date(date: Date): string;
+
+ /**
+ * specifies the text in the columns
+ * @param field_name the column id
+ * @param event the event object
+ */
+ grid_field(field_name: string, event: any): string;
+
+ /**
+ * specifies the number of scheduled events in a cell of the view
+ * @param evs an array of objects of events contained in a cell
+ */
+ timeline_cell_value(evs: any): string;
+
+ /**
+ * specifies the css style for a cell of the view
+ * @param evs an array of objects of events contained in a cell (defined only in the 'cell' mode)
+ * @param date the date of a column
+ * @param section the section object
+ */
+ timeline_cell_class(evs: any, date : Date, section: any): string;
+
+ /**
+ * specifies the name of a CSS class that will be applied to items of the X-Axis
+ * @param date the date which needs formatting
+ */
+ timeline_scalex_class(date: Date): string;
+
+ /**
+ * specifies the name of a CSS class that will be applied to items of the second X-Axis
+ * @param date the date which needs formatting
+ */
+ timeline_second_scalex_class(date: Date): string;
+
+ /**
+ * specifies the name of a CSS class that will be applied to items of the Y-Axis
+ * @param key the section id
+ * @param label the section label
+ * @param section the section object that contains the key and label properties
+ */
+ timeline_scaley_class(key: string, label : string, section: any): string;
+
+ /**
+ * specifies items of the Y-Axis
+ * @param key the section id (key)
+ * @param label the section label
+ * @param section the section object containing the key and label properties
+ */
+ timeline_scale_label(key : string, label : string, section : any): string;
+
+ /**
+ * specifies the tooltip over a day cell containing some scheduled event(s)
+ * @param start the date when an event is scheduled to begin
+ * @param end the date when an event is scheduled to be completed
+ * @param event the event object
+ */
+ timeline_tooltip(start: Date, end: Date, event: any): string;
+
+ /**
+ * specifies the date in the header of the view
+ * @param date1 the date when an event is scheduled to begin
+ * @param date2 the date when an event is scheduled to be completed
+ */
+ timeline_date(date1 : Date, date2 : Date): string;
+
+ /**
+ * specifies items of the X-Axis
+ * @param date the date which needs formatting
+ */
+ timeline_scale_date(date: Date): string;
+
+ /**
+ * specifies items of the second X-Axis
+ * @param date the date which needs formatting
+ */
+ timeline_second_scale_date(date: Date): string;
+
+ /**
+ * specifies the date in the header of the view
+ * @param date the date which needs formatting
+ */
+ units_date(date: Date): string;
+
+ /**
+ * specifies items of the X-Axis
+ * @param key the unit id (key)
+ * @param label the unit label
+ * @param unit the unit object containing the key and label properties
+ */
+ units_scale_text(key : string, label : string, unit : any): string;
+}
+
+interface SchedulerConfigOptions{
+ /**
+ * 'says' to present the numbers of days in the Month view as clickable links that open the related day in the specified view
+ */
+ active_link_view: string;
+
+ /**
+ * sets the date to display events until
+ */
+ agenda_end: Date;
+
+ /**
+ * sets the date to start displaying events from
+ */
+ agenda_start: Date;
+
+ /**
+ * 'says' to show multi-day events in the regular way (as one-day events are displayed)
+ */
+ all_timed: any;
+
+ /**
+ * sets the date format that will be used by the addEvent() method to parse the start_date, end_date properties in case they are specified as strings
+ */
+ api_date: string;
+
+ /**
+ * enables automatic changing of the end event date after changing the start date
+ */
+ auto_end_date: boolean;
+
+ /**
+ * stores a collection of buttons resided in the left bottom corner of the lightbox
+ */
+ buttons_left: any;
+
+ /**
+ * stores a collection of buttons resided in the right bottom corner of the lightbox
+ */
+ buttons_right: any;
+
+ /**
+ * sets the maximum number of events in a cascade
+ */
+ cascade_event_count: number;
+
+ /**
+ * sets the 'cascade' display mode
+ */
+ cascade_event_display: boolean;
+
+ /**
+ * sets the left margin for a cascade of events
+ */
+ cascade_event_margin: number;
+
+ /**
+ * activates/disables checking of limits
+ */
+ check_limits: boolean;
+
+ /**
+ * sets the maximum allowable number of events per time slot
+ */
+ collision_limit: number;
+
+ /**
+ * forces the scheduler container to automatically change its size to show the whole content without scrolling
+ */
+ container_autoresize: boolean;
+
+ /**
+ * sets the format for the date in the header of the Week and Units views
+ */
+ day_date: string;
+
+ /**
+ * enables the possibility to create events by double click
+ */
+ dblclick_create: boolean;
+
+ /**
+ * sets the date format used by the templates 'day_date', 'week_date', 'day_scale_date' for setting date in the views' headers
+ */
+ default_date: string;
+
+ /**
+ * 'says' to use the extended form while creating new events by drag or double click
+ */
+ details_on_create: boolean;
+
+ /**
+ * 'says' to open the extended form after double clicking on an event
+ */
+ details_on_dblclick: boolean;
+
+ /**
+ * defines whether the marked(blocked) time spans should be highlighted in the scheduler
+ */
+ display_marked_timespans: boolean;
+
+ /**
+ * sets the default background color for the events retrieved by the showEvent() method
+ */
+ displayed_event_color: string;
+
+ /**
+ * sets the default font color for the events retrieved by the showEvent() method
+ */
+ displayed_event_text_color: string;
+
+ /**
+ * enables the possibility to create new events by drag-and-drop
+ */
+ drag_create: boolean;
+
+ /**
+ * enables the possibility to drag the lightbox by the header
+ */
+ drag_lightbox: boolean;
+
+ /**
+ * enables the possibility to move events by drag-and-drop
+ */
+ drag_move: boolean;
+
+ /**
+ * enables the possibility to resize events by drag-and-drop
+ */
+ drag_resize: boolean;
+
+ /**
+ * 'says' to open the lightbox while creating new events
+ */
+ edit_on_create: boolean;
+
+ /**
+ * sets the initial duration of events in minutes
+ */
+ event_duration: number;
+
+ /**
+ * sets the minimum value for the hour scale (Y-Axis)
+ */
+ first_hour: number;
+
+ /**
+ * moves views' tabs from the left to the right side
+ */
+ fix_tab_position: boolean;
+
+ /**
+ * enables setting of the event duration to the full day
+ */
+ full_day: boolean;
+
+ /**
+ * specifies whether events retrieved by the showEvent method should be highlighted while displaying
+ */
+ highlight_displayed_event: boolean;
+
+ /**
+ * sets the format of Y-Axis items
+ */
+ hour_date: string;
+
+ /**
+ * sets the height of an hour unit in pixels
+ */
+ hour_size_px: number;
+
+ /**
+ * stores a collection of icons visible in the side edit menu of the event box
+ */
+ icons_edit: any;
+
+ /**
+ * stores a collection of icons visible in the side selection menu of the event box
+ */
+ icons_select: any;
+
+ /**
+ * defines whether the date specified in the 'End by' field should be exclusive or inclusive
+ */
+ include_end_by: boolean;
+
+ /**
+ * sets the maximum value of the hour scale (Y-Axis)
+ */
+ last_hour: number;
+
+ /**
+ * adds the dotted left border to the scheduler
+ */
+ left_border: boolean;
+
+ /**
+ * specifies the lightbox object
+ */
+ lightbox: any;
+
+ /**
+ * defines the lightbox behavior while opening in the edit mode
+ */
+ lightbox_recurring: string;
+
+ /**
+ * sets the right border of the allowable date range
+ */
+ limit_end: Date;
+
+ /**
+ * sets the left border of the allowable date range
+ */
+ limit_start: Date;
+
+ /**
+ * sets the max and min values of the time selector in the lightbox to the values of the 'last_hour' and 'first_hour' options
+ */
+ limit_time_select: boolean;
+
+ /**
+ * limits viewing events
+ */
+ limit_view: boolean;
+
+ /**
+ * sets the format of server request parameters 'from', 'to' in case of dynamic loading
+ */
+ load_date: string;
+
+ /**
+ * sets the date to display events until
+ */
+ map_end: Date;
+
+ /**
+ * sets the position that will be displayed on the map in case the event location can't be identified
+ */
+ map_error_position: any;
+
+ /**
+ * the maximum width of the Google Maps's popup marker in the Map view
+ */
+ map_infowindow_max_width: number;
+
+ /**
+ * sets the initial position of the map
+ */
+ map_initial_position: any;
+
+ /**
+ * sets the initial zoom of Google Maps in the Map view
+ */
+ map_initial_zoom: number;
+
+ /**
+ * activates attempts to resolve the event location if the database doesn't have the event's coordinates stored
+ */
+ map_resolve_event_location: boolean;
+
+ /**
+ * enables/disables prompts asking the user to share his location for displaying on the map
+ */
+ map_resolve_user_location: boolean;
+
+ /**
+ * sets the date to start displaying events from
+ */
+ map_start: Date;
+
+ /**
+ * sets the type of Google Maps
+ */
+ map_type: any;
+
+ /**
+ * sets the zoom that will be used to show the user's location if he agrees to the browser offer to show it
+ */
+ map_zoom_after_resolve: number;
+
+ /**
+ * enables/disables the marker displaying the current time
+ */
+ mark_now: boolean;
+
+ /**
+ * sets the maximum number of displayable in a cell events
+ */
+ max_month_events: number;
+
+ /**
+ * specifies the minicalendar object
+ */
+ minicalendar: any;
+
+ /**
+ * sets the format for the header of the Month view
+ */
+ month_date: string;
+
+ /**
+ * sets the format for the day in a cell of the Month and Year views
+ */
+ month_day: string;
+
+ /**
+ * sets the minimum height of cells in the Month view
+ */
+ month_day_min_height: number;
+
+ /**
+ * enables rendering of multi-day events
+ */
+ multi_day: boolean;
+
+ /**
+ * sets the height of the area that displays multi-day events
+ */
+ multi_day_height_limit: any;
+
+ /**
+ * allows working with recurring events independently of time zones
+ */
+ occurrence_timestamp_in_utc: boolean;
+
+ /**
+ * defines the 'saving' behaviour for the case when the user edits the event text directly in the event box
+ */
+ positive_closing: boolean;
+
+ /**
+ * fixes dnd in case of non-linear time scale
+ */
+ preserve_length: boolean;
+
+ /**
+ * cancels preserving of the current scroll position while navigating between dates of the same view
+ */
+ preserve_scroll: boolean;
+
+ /**
+ * enables/disables caching of GET requests in the browser
+ */
+ prevent_cache: boolean;
+
+ /**
+ * defines whether the event form will appear from the left/right side of the screen or near the selected event
+ */
+ quick_info_detached: boolean;
+
+ /**
+ * activates the read-only mode for the scheduler
+ */
+ readonly: boolean;
+
+ /**
+ * activates the read-only mode for the lightbox
+ */
+ readonly_form: boolean;
+
+ /**
+ * sets the date format of the 'End by' field in the 'recurring' lighbox
+ */
+ repeat_date: string;
+
+ /**
+ * prevents including past days to events with the 'weekly' recurrence
+ */
+ repeat_precise: boolean;
+
+ /**
+ * sets the initial position of the vertical scroll in the scheduler (an hour in the 24h format)
+ */
+ scroll_hour: number;
+
+ /**
+ * shows/hides the select bar in the event box
+ */
+ select: boolean;
+
+ /**
+ * allows preventing short events from overlapping
+ */
+ separate_short_events: boolean;
+
+ /**
+ * enables converting server-side dates from UTC to a local time zone (and backward) during sending data to the server
+ */
+ server_utc: boolean;
+
+ /**
+ * enables showing a progress/spinner while data is loading (useful for dynamic loading)
+ */
+ show_loading: boolean;
+
+ /**
+ * sets the start day of weeks
+ */
+ start_on_monday: boolean;
+
+ /**
+ * sets the minimum step (in minutes) for event's time values
+ */
+ time_step: number;
+
+ /**
+ * enables/disables the touch support in the scheduler
+ */
+ touch: any;
+
+ /**
+ * defines the time period in milliseconds that is used to differ the long touch gesture from the scroll gesture
+ */
+ touch_drag: any;
+
+ /**
+ * enables/disables prompting messages in the right up corner of the screen
+ */
+ touch_tip: boolean;
+
+ /**
+ * 'says' events to occupy the whole width of the cell
+ */
+ use_select_menu_space: boolean;
+
+ /**
+ * sets the format for the date in the sub-header of the Month view
+ */
+ week_date: string;
+
+ /**
+ * enables/disables displaying the standard (wide) lightbox instead of the short one
+ */
+ wide_form: boolean;
+
+ /**
+ * sets the date format that is used to parse data from the data set
+ */
+ xml_date: string;
+
+ /**
+ * sets the number of rows in the Year view
+ */
+ year_x: number;
+
+ /**
+ * sets the number of columns in the Year view
+ */
+ year_y: number;
+}
+
+
+interface SchedulerDateHelpers{
+ add(origin: Date, count: number, unit: string): Date;
+ copy(origin: Date): Date;
+
+ date_part(origin: Date): Date;
+ time_part(origin: Date): Date;
+
+ day_start(origin: Date): Date;
+ month_start(origin: Date): Date;
+ week_start(origin: Date): Date;
+ year_start(origin: Date): Date;
+
+ getISOWeek(origin: Date): number;
+ getUTCISOWeek(origin: Date): number;
+
+ date_to_str(format: string): any;
+ str_to_date(format: string): any;
+ convert_to_utc(origin: Date): Date;
+ to_fixed(value: number): string;
+}
+
+interface SchedulerHotkeys{
+ edit_save: number;
+ edit_cancel: number;
+}
+
+//scheduler.locale
+
+interface SchedulerLocaleDate{
+ month_full: string[];
+ month_short: string[];
+ day_full: string[];
+ day_short: string[];
+}
+
+interface SchedulerLocaleLabels{
+ dhx_cal_today_button: string;
+ day_tab: string;
+ week_tab: string;
+ month_tab: string;
+ new_event: string;
+ icon_save: string;
+ icon_cancel: string;
+ icon_details: string;
+ icon_edit: string;
+ icon_delete: string;
+ confirm_closing: string;
+ confirm_deleting: string;
+ section_description: string;
+ section_time: string;
+}
+
+interface SchedulerLocale{
+ date: SchedulerLocaleDate;
+ labels: SchedulerLocaleLabels;
+}
+
+interface SchedulerSizes{
+ /**
+ * the height of day cells in the month view
+ */
+ bar_height: number;
+
+ /**
+ * the width of the event text input 140 day
+ */
+ editor_width: number;
+
+ /**
+ * increases the length of the lightbox
+ */
+ lightbox_additional_height: number;
+
+ /**
+ * the width of the date column in the Map view
+ */
+ map_date_width: number;
+
+ /**
+ * the width of the description column in the Map view
+ */
+ map_description_width: number;
+
+ /**
+ * the left margin of the main scheduler area
+ */
+ margin_left: number;
+
+ /**
+ * the bottom margin of the main scheduler area
+ */
+ margin_top: number;
+
+ /**
+ * the width of the selection menu
+ */
+ menu_width: number;
+
+ /**
+ * the minimal height of the event box
+ */
+ min_event_height: number;
+
+ /**
+ * the top offset of an event in a cell in the month view
+ */
+ month_scale_height: number;
+
+ /**
+ * the height of the navigation bar
+ */
+ nav_height: number;
+
+ /**
+ * the height of the X-Axis
+ */
+ scale_height: number;
+
+ /**
+ * the width of the Y-Axis
+ */
+ scale_width: number;
+
+ /**
+ * the width of the scrollbar area
+ */
+ scroll_width: number;
+}
+
+interface SchedulerStatic{
+ templates: SchedulerTemplates;
+ config: SchedulerConfigOptions;
+ date: SchedulerDateHelpers;
+ keys: SchedulerHotkeys;
+ skin: String;
+ version: String;
+ xy: SchedulerSizes;
+ locale: SchedulerLocale;
+
+ /**
+ * adds a new event
+ * @param event the event object
+ */
+ addEvent(event: any): string;
+
+ /**
+ * adds a new event and opens the lightbox to confirm
+ * @param event the event object
+ */
+ addEventNow(event: any): string;
+
+ /**
+ * marks dates but with certain settings makes blocking (unlike blockTime() allows setting custom styling for the limit)
+ * @param config the configuration object of the timespan to mark/block
+ */
+ addMarkedTimespan(config: any);
+
+ /**
+ * adds a section to the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored)
+ * @param section the object of the section to add
+ * @param parent_id the id of the parent section. Pass 'null' if you are adding a section to the root
+ */
+ addSection(section: any, parent_id: string): boolean;
+
+ /**
+ * attaches the handler to an inner event of dhtmlxScheduler
+ * @param name the event name, case-insensitive
+ * @param handler the handler function
+ */
+ attachEvent(name: string, handler: (...args: any[])=>any): string;
+
+ /**
+ * makes the scheduler reflect all data changes in the Backbone model and vice versa
+ * @param events the Backbone data collection
+ */
+ backbone(events: any);
+
+ /**
+ * blocks the specified date and applies the default 'dimmed' style to it.
+ * @param date a date to block ( if a number is provided, the parameter will be treated as a week day: '0' index refers to Sunday, '6' - to Saturday)
+ * @param time_points an array [start_minute,end_minute,..,start_minute_N,end_minute_N] where each pair sets a certain limit range. The array can have any number of such pairs
+ * @param items defines specific items of view(s) to block
+ */
+ blockTime(date: any, time_points: any, items?: any);
+
+ /**
+ * calls an inner event
+ * @param name the event name, case-insensitive
+ * @param params an array of the event related data
+ */
+ callEvent(name: string, params: any): boolean;
+
+ /**
+ * changes the event id
+ * @param id the current event id
+ * @param new_id the new event id
+ */
+ changeEventId(id: string, new_id: string);
+
+ /**
+ * checks whether the specified event occurs at the time that has been already occupied with another event(s)
+ * @param event the event object
+ */
+ checkCollision(event: any): boolean;
+
+ /**
+ * checks whether an event has some handler(s) specified
+ * @param name the event name
+ */
+ checkEvent(name: string): boolean;
+
+ /**
+ * checks whether an event resides in a specific timespan
+ * @param event the event object
+ * @param timespan the timespan type
+ */
+ checkInMarkedTimespan(event: any, timespan: string): boolean;
+
+ /**
+ * checks whether the specified event takes place at the blocked time period
+ * @param event the event object
+ */
+ checkLimitViolation(event: any): boolean;
+
+ /**
+ * removes all events from the scheduler
+ */
+ clearAll();
+
+ /**
+ * closes all sections in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored)
+ */
+ closeAllSections();
+
+ /**
+ * closes the specified section in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored)
+ * @param section_id the section id
+ */
+ closeSection(section_id: string);
+
+ /**
+ * collapses the expanded scheduler back to the normal size
+ */
+ collapse();
+
+ /**
+ * creates the Grid view in the scheduler
+ * @param config the configuration object of the Grid view
+ */
+ createGridView(config: any);
+
+ /**
+ * creates the Timeline view in the scheduler
+ * @param config the configuration object of the Timeline view
+ */
+ createTimelineView(config: any);
+
+ /**
+ * creates the Units view in the scheduler
+ * @param config the configuration object of the Units view
+ */
+ createUnitsView(config: any);
+
+ /**
+ * deletes all sections from the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored)
+ */
+ deleteAllSections();
+
+ /**
+ * deletes the specified event
+ * @param id the event id
+ */
+ deleteEvent(id: any);
+
+ /**
+ * removes marking/blocking set by the addMarkedTimespan() and blockTime() methods
+ * @param id the timespan id
+ */
+ deleteMarkedTimespan(id: string);
+
+ /**
+ * deletes a section from the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored)
+ * @param section_id the section id
+ */
+ deleteSection(section_id: string): boolean;
+
+ /**
+ * destroys previously created mini-calendar
+ * @param name the mini-calendar's object (if not specified, the scheduler attempts to destroy the last created mini calendar)
+ */
+ destroyCalendar(name?: any);
+
+ /**
+ * detaches a handler from an event (which was attached before by the attachEvent method)
+ * @param id the event id
+ */
+ detachEvent(id: string);
+
+ /**
+ * opens the inline editor to alter the event text (the editor in the event box)
+ * @param id the event id
+ */
+ edit(id: string);
+
+ /**
+ * closes the inline event edotor if it's currently open
+ * @param id the event id
+ */
+ editStop(id: string);
+
+ /**
+ * closes the lightbox
+ * @param mode if set to true, the changes made in the lightbox will be saved before closing. If - false, the changes will be cancelled.
+ * @param box the HTML container for the lightbox
+ */
+ endLightbox(mode: boolean, box: HTMLElement);
+
+ /**
+ * expands the scheduler to the full screen view
+ */
+ expand();
+
+ /**
+ * gives access to the objects of lightbox's sections
+ * @param name the name of a lightbox section
+ */
+ formSection(name: string): any;
+
+ /**
+ * returns the current cursor-pointed date and section (if defined)
+ * @param e a native event object
+ */
+ getActionData(e: Event): any;
+
+ /**
+ * return the event object by its id
+ * @param event_id event_id
+ */
+ getEvent(event_id: any);
+
+ /**
+ * gets the event's end date
+ * @param id the event id
+ */
+ getEventEndDate(id: string): Date;
+
+ /**
+ * gets the event's start date
+ * @param id the event id
+ */
+ getEventStartDate(id: string): Date;
+
+ /**
+ * gets the event's text
+ * @param id the event id
+ */
+ getEventText(id: string): string;
+
+ /**
+ * returns a collection of events which occur during the specified period
+ * @param from the start date of the period
+ * @param to the end date of the period
+ */
+ getEvents(from?: Date, to?: Date);
+
+ /**
+ * gets the label of a select control in the lighbox
+ * @param property the name of a data property that the control is mapped to
+ * @param key the option id. This parameter is compared with the event data property to assign the select's option to an event
+ */
+ getLabel(property: string, key: any);
+
+ /**
+ * gets the lightbox's HTML object element
+ */
+ getLightbox(): HTMLElement;
+
+ /**
+ * returns all occurrences of a recurring event
+ * @param id the id of a recurring event
+ * @param number the maximum number of occurrences to return (by default, 100)
+ */
+ getRecDates(id: string, number: number): any;
+
+ /**
+ * gets the object of the currently displayable event
+ * @param id the event id
+ */
+ getRenderedEvent(id: string): HTMLElement;
+
+ /**
+ * gets the object of the specified section in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored)
+ * @param section_id the section id
+ */
+ getSection(section_id: string): any;
+
+ /**
+ * gets the current state of the scheduler
+ */
+ getState(): any;
+
+ /**
+ * gets the user data associated with the specified event
+ * @param id the event id
+ * @param name the user data name
+ */
+ getUserData(id: string, name: string): any;
+
+ /**
+ * hides the lightbox modal overlay that blocks interactions with the remaining screen
+ * @param box an element to hide
+ */
+ hideCover(box?: HTMLElement);
+
+ /**
+ * hides the pop-up event form (if it's currently active)
+ */
+ hideQuickInfo();
+
+ /**
+ * initializes an instance of dhtmlxScheduler
+ * @param container the id or object of the HTML container that the scheduler will be created inside
+ * @param date the initial date of the scheduler (by default, the current date)
+ * @param view the name of the initial view (by default, "week")
+ */
+ init(container: any, date?: Date, view?: string);
+
+ /**
+ * inverts the specified time zones
+ * @param zones an array [start_minute,end_minute,..,start_minute_N,end_minute_N] where each pair sets a certain limit range (in minutes). The array can have any number of such pairs
+ */
+ invertZones(zones: any);
+
+ /**
+ * checks whether the calendar is currently open in the scheduler
+ */
+ isCalendarVisible(): any;
+
+ /**
+ * checks whether the specified event one-day or multi-day
+ * @param event the event object
+ */
+ isOneDayEvent(event: any): boolean;
+
+ /**
+ * 'says' to change the active date in the mini calendar each time the active date in the scheduler is changed
+ * @param calendar the mini calendar object
+ * @param shift a function that defines the difference between active dates in the mini-calendar and the scheduler. The function takes the scheduler's date as a parameter and returns the date that should be displayed in the mini calendar
+ */
+ linkCalendar(calendar: any, shift: (...args: any[])=>any);
+
+ /**
+ * loads data to the scheduler from an external data source
+ * @param url the server side url (may be a static file or a server side script which outputs data as XML)
+ * @param type ('json', 'xml', 'ical') the data type. The default value - 'xml'
+ * @param callback the callback function
+ */
+ load(url: string, type?: string, callback?: (...args: any[])=>any);
+
+ /**
+ * applies a css class to the specified date
+ * @param calendar the calendar object
+ * @param date the date to mark
+ * @param css the name of a css class
+ */
+ markCalendar(calendar: any, date: Date, css: string);
+
+ /**
+ * marks and/or blocks date(s) by applying the default or a custom style to them. Marking is cancelled right after any internal update in the app. Can be used for highlighting
+ * @param config the configuration object of the timespan to mark/block
+ */
+ markTimespan(config: any);
+
+ /**
+ * opens all sections in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored)
+ */
+ openAllSections();
+
+ /**
+ * opens the specified section in the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored)
+ * @param section_id the section id
+ */
+ openSection(section_id: string);
+
+ /**
+ * loads data from a client-side resource
+ * @param data a string or object which represents data
+ * @param type ('json', 'xml', 'ical') the data type. The default value - 'xml'
+ */
+ parse(data: any, type?: string);
+
+ /**
+ * creates a mini calendar
+ * @param config the calendar configuration object
+ */
+ renderCalendar(config: any);
+
+ /**
+ * generates the HTML content for a custom event box
+ * @param container the event container
+ * @param event the event object
+ */
+ renderEvent(container: HTMLElement, event: any): boolean;
+
+ /**
+ * removes the current lightbox's HTML object element
+ */
+ resetLightbox();
+
+ /**
+ * scrolls the specified number of units in the Units view
+ * @param step the number of units to scroll (set the positive value to scroll units in the right direction, the negative value - in the left direction).
+ */
+ scrollUnit(step: number);
+
+ /**
+ * selects the specified event
+ * @param id the event id
+ */
+ select(id: string);
+
+ /**
+ * returns a list of options
+ * @param list_name the name of a list
+ * @param options an array of options
+ */
+ serverList(list_name: string, options?: any);
+
+ /**
+ * displays the specified view and date
+ * @param date the date to display
+ * @param view the name of a view to display
+ */
+ setCurrentView(date?: Date, view?: string);
+
+ /**
+ * adds a new event to the scheduler's data pool
+ * @param id the event id
+ * @param event the event object
+ */
+ setEvent(id: any, event: any);
+
+ /**
+ * sets the event's end date
+ * @param id the event id
+ * @param date the new end date of the event
+ */
+ setEventEndDate(id: string, date: Date);
+
+ /**
+ * set the event's start date
+ * @param id the event id
+ * @param date the new start date of the event
+ */
+ setEventStartDate(id: string, date: Date);
+
+ /**
+ * set the event's text
+ * @param id the event id
+ * @param text the new text of the event
+ */
+ setEventText(id: string, text: string);
+
+ /**
+ * forces the lightbox to resize
+ */
+ setLightboxSize();
+
+ /**
+ * sets the mode that allows loading data by parts (enables the dynamic loading)
+ * @param mode the loading mode
+ */
+ setLoadMode(mode: string);
+
+ /**
+ * sets the user data associated with the specified event
+ * @param id the event id
+ * @param name the user data name
+ * @param value the user data value
+ */
+ setUserData(id: string, name: string, value: any);
+
+ /**
+ * shows the lightbox modal overlay that blocks interactions with the remaining screen
+ * @param box an element to hide
+ */
+ showCover(box?: HTMLElement);
+
+ /**
+ * shows and highlights the specified event in the current or specified view
+ * @param id the event id
+ * @param view the view name
+ */
+ showEvent(id: string, view?: string);
+
+ /**
+ * opens the lightbox for the specified event
+ * @param id the event id
+ */
+ showLightbox(id: string);
+
+ /**
+ * displays the pop-up event form for the specified event
+ * @param id the event id
+ */
+ showQuickInfo(id: string);
+
+ /**
+ * shows a custom lightbox in the specified HTML container centered on the screen
+ * @param id the event id
+ * @param box the lightbox's HTML container
+ */
+ startLightbox(id : string, box: HTMLElement);
+
+ /**
+ * convers scheduler's data to the ICal format
+ * @param header sets the value for the content header field
+ */
+ toICal(header?: string): string;
+
+ /**
+ * converts scheduler's data into the JSON format
+ */
+ toJSON(): string;
+
+ /**
+ * exports the current view to a PDF document (can be used for printing)
+ * @param url the path to the server-side PDF converter
+ * @param mode the color map of the resulting PDF document
+ */
+ toPDF(url: string, mode?: string);
+
+ /**
+ * exports several scheduler's views to a PDF document (can be used for printing)
+ * @param from the date to start export events from
+ * @param to the date to export events until
+ * @param view the name of a view that the export should be applied to
+ * @param path the path to the php file which generates a PDF file (details)
+ * @param color the color map in use
+ */
+ toPDFRange(from: Date, to: Date, view: string, path: string, color: string);
+
+ /**
+ * converts scheduler's data into the XML format
+ */
+ toXML(): string;
+
+ /**
+ * generates an unique ID (unique inside the current scheduler, not GUID)
+ */
+ uid();
+
+ /**
+ * removes blocking set by the blockTime() method
+ * @param days (Date, number,array, string) days that should be limited
+ * @param zones the period in minutes that should be limited. Can be set to 'fullday' value to limit the entire day
+ * @param sections allows blocking date(s) just for specific items of specific views. BTW, the specified date(s) will be blocked just in the related view(s)
+ */
+ unblockTime(days: any, zones?: any, sections?: any);
+
+ /**
+ * removes a css class from the specified date
+ * @param calendar the mini calendar object
+ * @param date the date to unmark
+ * @param css the name of a css class to remove
+ */
+ unmarkCalendar(calendar: any, date: Date, css: string);
+
+ /**
+ * removes marking/blocking set by the markTimespan() method
+ * @param divs a timespan to remove marking/blocking from (or an array of timespans)
+ */
+ unmarkTimespan(divs: any);
+
+ /**
+ * unselects the specified event
+ * @param id the event id (if not specified, the currently selected event will be unselected)
+ */
+ unselect(id?: string);
+
+ /**
+ * displays the specified date in the mini calendar
+ * @param calendar the mini calendar object
+ * @param new_date a new date to display in the mini calendar
+ */
+ updateCalendar(calendar: any, new_date: Date);
+
+ /**
+ * updates tht specified collection with new options
+ * @param collection the name of the collection to update
+ * @param options the new values of the collection
+ */
+ updateCollection(collection: string, options: any): boolean;
+
+ /**
+ * updates the specified event
+ * @param id the event id
+ */
+ updateEvent(id: string);
+
+ /**
+ * displays the specified view and date (doesn't invokes any events)
+ * @param date the date to set
+ * @param view the view name
+ */
+ updateView(date: Date, view: string);
+}
+
+
+
+declare var scheduler: SchedulerStatic;
\ No newline at end of file
diff --git a/dhtmlxscheduler/dhtmlxscheduler.d.ts.tscparams b/dhtmlxscheduler/dhtmlxscheduler.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/dhtmlxscheduler/dhtmlxscheduler.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/domo/domo-tests.ts.tscparams b/domo/domo-tests.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/domo/domo-tests.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/dropzone/dropzone.d.ts.tscparams b/dropzone/dropzone.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/dropzone/dropzone.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/durandal/durandal-1.x.d.ts.tscparams b/durandal/durandal-1.x.d.ts.tscparams
new file mode 100644
index 0000000000..e16c76dff8
--- /dev/null
+++ b/durandal/durandal-1.x.d.ts.tscparams
@@ -0,0 +1 @@
+""
diff --git a/durandal/durandal.d.ts b/durandal/durandal.d.ts
index a8335413da..c2567f62c5 100644
--- a/durandal/durandal.d.ts
+++ b/durandal/durandal.d.ts
@@ -1,5 +1,5 @@
/**
- * Durandal 2.0.0 Copyright (c) 2012 Blue Spire Consulting, Inc. All Rights Reserved.
+ * Durandal 2.0.1 Copyright (c) 2012 Blue Spire Consulting, Inc. All Rights Reserved.
* Available via the MIT license.
* see: http://durandaljs.com or https://github.com/BlueSpire/Durandal for details.
*/
@@ -116,7 +116,7 @@ declare module 'durandal/system' {
* @param {object} extension* Uses to extend the target object.
*/
export function extend(obj: any, ...extensions: any[]): any;
-
+
/**
* Uses a setTimeout to wait the specified milliseconds.
* @param {number} milliseconds The number of milliseconds to wait.
@@ -226,7 +226,7 @@ declare module 'durandal/viewEngine' {
* @returns {boolean} True if the url is a view url, false otherwise.
*/
export function isViewUrl(url: string):boolean;
-
+
/**
* Converts a view url into a view id.
* @param {string} url The url to convert.
@@ -285,62 +285,8 @@ declare module 'durandal/viewEngine' {
* @requires system
*/
declare module 'durandal/events' {
- import ts = require('durandal/typescript');
-
- /**
- * Creates an object with eventing capabilities.
- * @class Events
- */
- class Events {
- constructor();
-
- /**
- * Creates a subscription or registers a callback for the specified event.
- * @param {string} events One or more events, separated by white space.
- * @returns {Subscription} A subscription is returned.
- */
- on(events: string): ts.EventSubscription;
-
- /**
- * Creates a subscription or registers a callback for the specified event.
- * @param {string} events One or more events, separated by white space.
- * @param {function} [callback] The callback function to invoke when the event is triggered.
- * @param {object} [context] An object to use as `this` when invoking the `callback`.
- * @returns {Events} The events object is returned for chaining.
- */
- on(events: string, callback: Function, context?: any): Events;
-
- /**
- * Removes the callbacks for the specified events.
- * @param {string} [events] One or more events, separated by white space to turn off. If no events are specified, then the callbacks will be removed.
- * @param {function} [callback] The callback function to remove. If `callback` is not provided, all callbacks for the specified events will be removed.
- * @param {object} [context] The object that was used as `this`. Callbacks with this context will be removed.
- * @chainable
- */
- off(events: string, callback: Function, context?: any): Events;
-
- /**
- * Triggers the specified events.
- * @param {string} [events] One or more events, separated by white space to trigger.
- * @chainable
- */
- trigger(events: string, ...eventArgs: any[]): Events;
-
- /**
- * Creates a function that will trigger the specified events when called. Simplifies proxying jQuery (or other) events through to the events object.
- * @param {string} events One or more events, separated by white space to trigger by invoking the returned function.
- * @returns {function} Calling the function will invoke the previously specified events on the events object.
- */
- proxy(events: string): Function;
-
- /**
- * Adds eventing capabilities to the specified object.
- * @param {object} targetObject The object to add eventing capabilities to.
- */
- static includeIn(targetObject: any): void;
- }
-
- export = Events;
+ var theModule: DurandalEventModule;
+ export = theModule;
}
/**
@@ -389,7 +335,7 @@ declare module 'durandal/binder' {
* @param {object} [obj] The data to bind to, causing the creation of a child binding context if present.
*/
export function bindContext(bindingContext: KnockoutBindingContext, view: HTMLElement, obj?: any): BindingInstruction;
-
+
/**
* Binds the view, preserving the existing binding context. Optionally, a new context can be created, parented to the previous context.
* @param {object} obj The data to bind to.
@@ -407,136 +353,12 @@ declare module 'durandal/binder' {
* @requires knockout
*/
declare module 'durandal/activator' {
- interface ActivatorSettings {
- /**
- * The default value passed to an object's deactivate function as its close parameter.
- * @default true
- */
- closeOnDeactivate: boolean;
-
- /**
- * Lower-cased words which represent a truthy value.
- * @default ['yes', 'ok', 'true']
- */
- affirmations: string[];
-
- /**
- * Interprets the response of a `canActivate` or `canDeactivate` call using the known affirmative values in the `affirmations` array.
- * @param {object} value
- * @returns {boolean}
- */
- interpretResponse(value: any): boolean;
-
- /**
- * Determines whether or not the current item and the new item are the same.
- * @param {object} currentItem
- * @param {object} newItem
- * @param {object} currentActivationData
- * @param {object} newActivationData
- * @returns {boolean}
- */
- areSameItem(currentItem: any, newItem: any, currentActivationData: any, newActivationData: any): boolean;
-
- /**
- * Called immediately before the new item is activated.
- * @param {object} newItem
- */
- beforeActivate(newItem: any): any;
-
- /**
- * Called immediately after the old item is deactivated.
- * @param {object} oldItem The previous item.
- * @param {boolean} close Whether or not the previous item was closed.
- * @param {function} setter The activate item setter function.
- */
- afterDeactivate(oldItem: any, close: boolean, setter: Function): void;
- }
-
- interface Activator extends KnockoutComputed {
- /**
- * The settings for this activator.
- */
- settings: ActivatorSettings;
-
- /**
- * An observable which indicates whether or not the activator is currently in the process of activating an instance.
- * @returns {boolean}
- */
- isActivating: KnockoutObservable;
-
- /**
- * Determines whether or not the specified item can be deactivated.
- * @param {object} item The item to check.
- * @param {boolean} close Whether or not to check if close is possible.
- * @returns {promise}
- */
- canDeactivateItem(item: T, close: boolean): JQueryPromise;
-
- /**
- * Deactivates the specified item.
- * @param {object} item The item to deactivate.
- * @param {boolean} close Whether or not to close the item.
- * @returns {promise}
- */
- deactivateItem(item: T, close: boolean): JQueryPromise;
-
- /**
- * Determines whether or not the specified item can be activated.
- * @param {object} item The item to check.
- * @param {object} activationData Data associated with the activation.
- * @returns {promise}
- */
- canActivateItem(newItem: T, activationData?: any): JQueryPromise;
-
- /**
- * Activates the specified item.
- * @param {object} newItem The item to activate.
- * @param {object} newActivationData Data associated with the activation.
- * @returns {promise}
- */
- activateItem(newItem: T, activationData?: any): JQueryPromise;
-
- /**
- * Determines whether or not the activator, in its current state, can be activated.
- * @returns {promise}
- */
- canActivate(): JQueryPromise;
-
- /**
- * Activates the activator, in its current state.
- * @returns {promise}
- */
- activate(): JQueryPromise;
-
- /**
- * Determines whether or not the activator, in its current state, can be deactivated.
- * @returns {promise}
- */
- canDeactivate(close: boolean): JQueryPromise;
-
- /**
- * Deactivates the activator, in its current state.
- * @returns {promise}
- */
- deactivate(close: boolean): JQueryPromise;
-
- /**
- * Adds canActivate, activate, canDeactivate and deactivate functions to the provided model which pass through to the corresponding functions on the activator.
- */
- includeIn(includeIn: any): void;
-
- /**
- * Sets up a collection representing a pool of objects which the activator will activate. See below for details. Activators without an item bool always close their values on deactivate. Activators with an items pool only deactivate, but do not close them.
- */
- forItems(items): Activator;
- }
-
/**
* The default settings used by activators.
* @property {ActivatorSettings} defaults
*/
- export var defaults: ActivatorSettings;
-
+ export var defaults: DurandalActivatorSettings;
+
/**
* Creates a new activator.
* @method create
@@ -544,7 +366,7 @@ declare module 'durandal/activator' {
* @param {ActivatorSettings} [settings] Per activator overrides of the default activator settings.
* @returns {Activator} The created activator.
*/
- export function create(initialActiveItem?: T, settings?: ActivatorSettings): Activator;
+ export function create(initialActiveItem?: T, settings?: DurandalActivatorSettings): DurandalActivator;
/**
* Determines whether or not the provided object is an activator or not.
@@ -568,7 +390,7 @@ declare module 'durandal/viewLocator' {
* @param {string} [areasPath] Partial views are mapped to the "views" folder if not specified. Use this parameter to change their location.
*/
export function useConvention(modulesPath?: string, viewsPath?: string, areasPath?: string): void;
-
+
/**
* Maps an object instance to a view instance.
* @param {object} obj The object to locate the view for.
@@ -577,7 +399,7 @@ declare module 'durandal/viewLocator' {
* @returns {Promise} A promise of the view.
*/
export function locateViewForObject(obj: any, area:string, elementsToSearch?: HTMLElement[]): JQueryPromise;
-
+
/**
* Converts a module id into a view id. By default the ids are the same.
* @param {string} moduleId The module id.
@@ -599,7 +421,7 @@ declare module 'durandal/viewLocator' {
* @returns {string} The translated view id.
*/
export function translateViewIdToArea(viewId: string, area: string): string;
-
+
/**
* Locates the specified view.
* @param {string|DOMElement} view A view. It will be immediately returned.
@@ -608,7 +430,7 @@ declare module 'durandal/viewLocator' {
* @returns {Promise} A promise of the view.
*/
export function locateView(view: HTMLElement, area?: string, elementsToSearch?: HTMLElement[]): JQueryPromise;
-
+
/**
* Locates the specified view.
* @param {string|DOMElement} viewUrlOrId A view url or view id to locate.
@@ -725,100 +547,8 @@ declare module 'durandal/composition' {
* @requires jquery
*/
declare module 'durandal/app' {
- import Events = require('durandal/events');
- import ts = require('durandal/typescript');
-
- /**
- * The title of your application.
- */
- export var title: string;
-
- /**
- * Shows a dialog via the dialog plugin.
- * @param {object|string} obj The object (or moduleId) to display as a dialog.
- * @param {object} [activationData] The data that should be passed to the object upon activation.
- * @param {string} [context] The name of the dialog context to use. Uses the default context if none is specified.
- * @returns {Promise} A promise that resolves when the dialog is closed and returns any data passed at the time of closing.
- */
- export function showDialog(obj: any, activationData?: any, context?: string):JQueryPromise;
-
- /**
- * Shows a message box via the dialog plugin.
- * @param {string} message The message to display in the dialog.
- * @param {string} [title] The title message.
- * @param {string[]} [options] The options to provide to the user.
- * @returns {Promise} A promise that resolves when the message box is closed and returns the selected option.
- */
- export function showMessage(message: string, title?: string, options?: string[]): JQueryPromise;
-
- /**
- * Configures one or more plugins to be loaded and installed into the application.
- * @method configurePlugins
- * @param {object} config Keys are plugin names. Values can be truthy, to simply install the plugin, or a configuration object to pass to the plugin.
- * @param {string} [baseUrl] The base url to load the plugins from.
- */
- export function configurePlugins(config: Object, baseUrl?: string): void;
-
- /**
- * Starts the application.
- * @returns {promise}
- */
- export function start(): JQueryPromise;
-
- /**
- * Sets the root module/view for the application.
- * @param {string} root The root view or module.
- * @param {string} [transition] The transition to use from the previous root (or splash screen) into the new root.
- * @param {string} [applicationHost] The application host element id. By default the id 'applicationHost' will be used.
- */
- export function setRoot(root: any, transition?: string, applicationHost?: string): void;
-
- /**
- * Sets the root module/view for the application.
- * @param {string} root The root view or module.
- * @param {string} [transition] The transition to use from the previous root (or splash screen) into the new root.
- * @param {string} [applicationHost] The application host element. By default the id 'applicationHost' will be used.
- */
- export function setRoot(root: any, transition?: string, applicationHost?: HTMLElement): void;
-
- /**
- * Creates a subscription or registers a callback for the specified event.
- * @param {string} events One or more events, separated by white space.
- * @returns {Subscription} A subscription is returned.
- */
- export function on(events: string): ts.EventSubscription;
-
- /**
- * Creates a subscription or registers a callback for the specified event.
- * @param {string} events One or more events, separated by white space.
- * @param {function} [callback] The callback function to invoke when the event is triggered.
- * @param {object} [context] An object to use as `this` when invoking the `callback`.
- * @returns {Events} The events object is returned for chaining.
- */
- export function on(events: string, callback: Function, context?: any): Events;
-
- /**
- * Removes the callbacks for the specified events.
- * @param {string} [events] One or more events, separated by white space to turn off. If no events are specified, then the callbacks will be removed.
- * @param {function} [callback] The callback function to remove. If `callback` is not provided, all callbacks for the specified events will be removed.
- * @param {object} [context] The object that was used as `this`. Callbacks with this context will be removed.
- * @chainable
- */
- export function off(events: string, callback: Function, context?: any): Events;
-
- /**
- * Triggers the specified events.
- * @param {string} [events] One or more events, separated by white space to trigger.
- * @chainable
- */
- export function trigger(events: string, ...eventArgs:any[]): Events;
-
- /**
- * Creates a function that will trigger the specified events when called. Simplifies proxying jQuery (or other) events through to the events object.
- * @param {string} events One or more events, separated by white space to trigger by invoking the returned function.
- * @returns {function} Calling the function will invoke the previously specified events on the events object.
- */
- export function proxy(events: string): Function;
+ var theModule: DurandalAppModule;
+ export = theModule;
}
/**
@@ -832,7 +562,6 @@ declare module 'durandal/app' {
* @requires knockout
*/
declare module 'plugins/dialog' {
- import activator = require('durandal/activator');
import composition = require('durandal/composition');
/**
@@ -907,7 +636,7 @@ declare module 'plugins/dialog' {
interface Dialog {
owner: any;
context: DialogContext;
- activator: activator.Activator;
+ activator: DurandalActivator;
close(): JQueryPromise;
settings: composition.CompositionContext;
}
@@ -947,7 +676,7 @@ declare module 'plugins/dialog' {
* @param {DialogContext} dialogContext The context to add.
*/
export function addContext(name: string, modalContext: DialogContext): void;
-
+
/**
* Gets the dialog model that is associated with the specified object.
* @param {object} obj The object for whom to retrieve the dialog.
@@ -958,9 +687,9 @@ declare module 'plugins/dialog' {
/**
* Closes the dialog associated with the specified object.
* @param {object} obj The object whose dialog should be closed.
- * @param {object} result* The results to return back to the dialog caller after closing.
+ * @param {object} results* The results to return back to the dialog caller after closing.
*/
- export function close(obj: any): void;
+ export function close(obj: any, ...results: any[]): void;
/**
* Shows a dialog.
@@ -993,41 +722,6 @@ declare module 'plugins/dialog' {
* @requires jquery
*/
declare module 'plugins/history' {
- interface HistoryOptions {
- /**
- * The function that will be called back when the fragment changes.
- */
- routeHandler: (fragment: string) => void;
-
- /**
- * The url root used to extract the fragment when using push state.
- */
- root?: string;
-
- /**
- * Use hash change when present.
- * @default true
- */
- hashChange?: boolean;
-
- /**
- * Use push state when present.
- * @default false
- */
- pushState?: boolean;
-
- /**
- * Prevents loading of the current url when activating history.
- * @default false
- */
- silent?: boolean;
- }
-
- interface NavigationOptions {
- trigger: boolean;
- replace: boolean;
- }
-
/**
* The setTimeout interval used when the browser does not support hash change events.
* @default 50
@@ -1059,7 +753,7 @@ declare module 'plugins/history' {
* @param {HistoryOptions} options.
* @returns {boolean|undefined} Returns true/false from loading the url unless the silent option was selected.
*/
- export function activate(options: HistoryOptions): boolean;
+ export function activate(options: DurandalHistoryOptions): boolean;
/**
* Disable history, perhaps temporarily. Not useful in a real app, but possibly useful for unit testing Routers.
@@ -1102,7 +796,7 @@ declare module 'plugins/history' {
* @param {object|boolean} options An options object with optional trigger and replace flags. You can also pass a boolean directly to set the trigger option. Trigger is `true` by default.
* @return {boolean} Returns true/false from loading the url.
*/
- export function navigate(fragment: string, options: NavigationOptions): boolean;
+ export function navigate(fragment: string, options: DurandalNavigationOptions): boolean;
/**
* Navigates back in the browser history.
@@ -1121,7 +815,7 @@ declare module 'plugins/http' {
* @default callback
*/
export var callbackParam: string;
-
+
/**
* Makes an HTTP GET request.
* @param {string} url The url to send the get request to.
@@ -1138,7 +832,7 @@ declare module 'plugins/http' {
* @returns {Promise} A promise of the response data.
*/
export function jsonp(url: string, query?: Object, callbackParam?: string): JQueryPromise;
-
+
/**
* Makes an HTTP POST request.
* @param {string} url The url to send the post request to.
@@ -1395,324 +1089,571 @@ declare module 'plugins/widget' {
* @requires jquery
*/
declare module 'plugins/router' {
- import activator = require('durandal/activator');
- import Events = require('durandal/events');
- import ts = require('durandal/typescript');
-
- var RootRouter: ts.RootRouter;
-
- export = RootRouter;
+ var theModule: DurandalRootRouter;
+ export = theModule;
}
-/**
- * Interface definitions used by other modules which were not possible to define within those modules due to TypeScript limitations.
- */
-declare module 'durandal/typescript' {
- import activator = require('durandal/activator');
- import history = require('plugins/history');
+interface DurandalEventSubscription {
+ /**
+ * Attaches a callback to the event subscription.
+ * @param {function} callback The callback function to invoke when the event is triggered.
+ * @param {object} [context] An object to use as `this` when invoking the `callback`.
+ * @chainable
+ */
+ then(thenCallback: Function, context?: any): DurandalEventSubscription;
/**
- * Represents an event subscription.
- * @class
- */
- export interface EventSubscription {
- /**
- * Attaches a callback to the event subscription.
- * @param {function} callback The callback function to invoke when the event is triggered.
- * @param {object} [context] An object to use as `this` when invoking the `callback`.
- * @chainable
- */
- then(thenCallback: Function, context?: any): EventSubscription;
+ * Attaches a callback to the event subscription.
+ * @param {function} [callback] The callback function to invoke when the event is triggered. If `callback` is not provided, the previous callback will be re-activated.
+ * @param {object} [context] An object to use as `this` when invoking the `callback`.
+ * @chainable
+ */
+ on(thenCallback: Function, context?: any): DurandalEventSubscription;
- /**
- * Attaches a callback to the event subscription.
- * @param {function} [callback] The callback function to invoke when the event is triggered. If `callback` is not provided, the previous callback will be re-activated.
- * @param {object} [context] An object to use as `this` when invoking the `callback`.
- * @chainable
- */
- on(thenCallback: Function, context?: any): EventSubscription;
-
- /**
- * Cancels the subscription.
- * @chainable
- */
- off(): EventSubscription;
- }
-
- export interface RouteConfiguration {
- title?: string;
- moduleId?: string;
- hash?: string;
- routePattern?: RegExp;
- isActive?: KnockoutComputed;
- }
-
- export interface RouteInstruction {
- fragment: string;
- queryString: string;
- config: RouteConfiguration;
- params: any[];
- queryParams: Object;
- }
-
- export interface RelativeRouteSettings {
- moduleId?: string;
- route?: string;
- fromParent?: boolean;
- }
-
- export interface Router {
- /**
- * The route handlers that are registered. Each handler consists of a `routePattern` and a `callback`.
- */
- handlers: { routePattern: RegExp; callback: (fragment: string) => void; }[];
-
- /**
- * The route configs that are registered.
- */
- routes: RouteConfiguration[];
-
- /**
- * The active item/screen based on the current navigation state.
- */
- activeItem: activator.Activator;
-
- /**
- * The route configurations that have been designated as displayable in a nav ui (nav:true).
- */
- navigationModel: KnockoutObservableArray;
-
- /**
- * Indicates that the router (or a child router) is currently in the process of navigating.
- */
- isNavigating: KnockoutComputed;
-
- /**
- * An observable surfacing the active routing instruction that is currently being processed or has recently finished processing.
- * The instruction object has `config`, `fragment`, `queryString`, `params` and `queryParams` properties.
- */
- activeInstruction: KnockoutObservable;
-
- /**
- * Parses a query string into an object.
- * @param {string} queryString The query string to parse.
- * @returns {object} An object keyed according to the query string parameters.
- */
- parseQueryString(queryString: string): Object;
-
- /**
- * Add a route to be tested when the url fragment changes.
- * @param {RegEx} routePattern The route pattern to test against.
- * @param {function} callback The callback to execute when the route pattern is matched.
- */
- route(routePattern: RegExp, callback: (fragment: string) => void ): void;
-
- /**
- * Attempt to load the specified URL fragment. If a route succeeds with a match, returns `true`. If no defined routes matches the fragment, returns `false`.
- * @param {string} fragment The URL fragment to find a match for.
- * @returns {boolean} True if a match was found, false otherwise.
- */
- loadUrl(fragment: string): boolean;
-
- /**
- * Updates the document title based on the activated module instance, the routing instruction and the app.title.
- * @param {object} instance The activated module.
- * @param {object} instruction The routing instruction associated with the action. It has a `config` property that references the original route mapping config.
- */
- updateDocumentTitle(instance: Object, instruction: RouteInstruction): void;
-
- /**
- * Save a fragment into the hash history, or replace the URL state if the
- * 'replace' option is passed. You are responsible for properly URL-encoding
- * the fragment in advance.
- * The options object can contain `trigger: false` if you wish to not have the
- * route callback be fired, or `replace: true`, if
- * you wish to modify the current URL without adding an entry to the history.
- * @param {string} fragment The url fragment to navigate to.
- * @param {object|boolean} options An options object with optional trigger and replace flags. You can also pass a boolean directly to set the trigger option. Trigger is `true` by default.
- * @return {boolean} Returns true/false from loading the url.
- */
- navigate(fragment: string, trigger?: boolean): boolean;
-
- /**
- * Save a fragment into the hash history, or replace the URL state if the
- * 'replace' option is passed. You are responsible for properly URL-encoding
- * the fragment in advance.
- * The options object can contain `trigger: false` if you wish to not have the
- * route callback be fired, or `replace: true`, if
- * you wish to modify the current URL without adding an entry to the history.
- * @param {string} fragment The url fragment to navigate to.
- * @param {object|boolean} options An options object with optional trigger and replace flags. You can also pass a boolean directly to set the trigger option. Trigger is `true` by default.
- * @return {boolean} Returns true/false from loading the url.
- */
- navigate(fragment: string, options: history.NavigationOptions): boolean;
-
- /**
- * Navigates back in the browser history.
- */
- navigateBack(): void;
-
- /**
- * Converts a route to a hash suitable for binding to a link's href.
- * @param {string} route
- * @returns {string} The hash.
- */
- convertRouteToHash(route: string): string;
-
- /**
- * Converts a route to a module id. This is only called if no module id is supplied as part of the route mapping.
- * @param {string} route
- * @returns {string} The module id.
- */
- convertRouteToModuleId(route: string): string;
-
- /**
- * Converts a route to a displayable title. This is only called if no title is specified as part of the route mapping.
- * @method convertRouteToTitle
- * @param {string} route
- * @returns {string} The title.
- */
- convertRouteToTitle(route: string): string;
-
- /**
- * Maps route patterns to modules.
- * @param {string} route A route.
- * @chainable
- */
- map(route: string): Router;
-
- /**
- * Maps route patterns to modules.
- * @param {string} route A route pattern.
- * @param {string} moduleId The module id to map the route to.
- * @chainable
- */
- map(route: string, moduleId: string): Router;
-
- /**
- * Maps route patterns to modules.
- * @param {RegExp} route A route pattern.
- * @param {string} moduleId The module id to map the route to.
- * @chainable
- */
- map(route: RegExp, moduleId: string): Router;
-
- /**
- * Maps route patterns to modules.
- * @param {string} route A route pattern.
- * @param {RouteConfiguration} config The route's configuration.
- * @chainable
- */
- map(route: string, config: RouteConfiguration): Router;
-
- /**
- * Maps route patterns to modules.
- * @method map
- * @param {RegExp} route A route pattern.
- * @param {RouteConfiguration} config The route's configuration.
- * @chainable
- */
- map(route: RegExp, config: RouteConfiguration): Router;
-
- /**
- * Maps route patterns to modules.
- * @param {RouteConfiguration} config The route's configuration.
- * @chainable
- */
- map(config: RouteConfiguration): Router;
-
- /**
- * Maps route patterns to modules.
- * @param {RouteConfiguration[]} configs An array of route configurations.
- * @chainable
- */
- map(configs: RouteConfiguration[]): Router;
-
- /**
- * Builds an observable array designed to bind a navigation UI to. The model will exist in the `navigationModel` property.
- * @param {number} defaultOrder The default order to use for navigation visible routes that don't specify an order. The defualt is 100.
- * @chainable
- */
- buildNavigationModel(defaultOrder?: number): Router;
-
- /**
- * Configures the router to map unknown routes to modules at the same path.
- * @chainable
- */
- mapUnknownRoutes(): Router;
-
- /**
- * Configures the router use the specified module id for all unknown routes.
- * @param {string} notFoundModuleId Represents the module id to route all unknown routes to.
- * @param {string} [replaceRoute] Optionally provide a route to replace the url with.
- * @chainable
- */
- mapUnknownRoutes(notFoundModuleId: string, replaceRoute?: string): Router;
-
- /**
- * Configures how the router will handle unknown routes.
- * @param {function} callback Called back with the route instruction containing the route info. The function can then modify the instruction by adding a moduleId and the router will take over from there.
- * @chainable
- */
- mapUnknownRoutes(callback: (instruction: RouteInstruction) => void ): Router;
-
- /**
- * Configures how the router will handle unknown routes.
- * @param {RouteConfiguration} config The route configuration to use for unknown routes.
- * @chainable
- */
- mapUnknownRoutes(config: RouteConfiguration): Router;
-
- /**
- * Resets the router by removing handlers, routes, event handlers and previously configured options.
- * @chainable
- */
- reset(): Router;
-
- /**
- * Makes all configured routes and/or module ids relative to a certain base url.
- * @param {string} settings The value is used as the base for routes and module ids.
- * @chainable
- */
- makeRelative(settings: string): Router;
-
- /**
- * Makes all configured routes and/or module ids relative to a certain base url.
- * @param {RelativeRouteSettings} settings If an object, you can specify `route` and `moduleId` separately. In place of specifying route, you can set `fromParent:true` to make routes automatically relative to the parent router's active route.
- * @chainable
- */
- makeRelative(settings: RelativeRouteSettings): Router;
-
- /**
- * Creates a child router.
- * @returns {Router} The child router.
- */
- createChildRouter(): Router;
-
- /**
- * Inspects routes and modules before activation. Can be used to protect access by cancelling navigation or redirecting.
- * @param {object} instance The module instance that is about to be activated by the router.
- * @param {object} instruction The route instruction. The instruction object has config, fragment, queryString, params and queryParams properties.
- * @returns {Promise|Boolean|String} If a boolean, determines whether or not the route should activate or be cancelled. If a string, causes a redirect to the specified route. Can also be a promise for either of these value types.
- */
- guardRoute?:(instance:Object, instruction:RouteInstruction) => any;
- }
-
- export interface RootRouter extends Router {
- /**
- * Activates the router and the underlying history tracking mechanism.
- * @returns {Promise} A promise that resolves when the router is ready.
- */
- activate(options?: history.HistoryOptions): JQueryPromise;
-
- /**
- * Disable history, perhaps temporarily. Not useful in a real app, but possibly useful for unit testing Routers.
- */
- deactivate(): void;
-
- /**
- * Installs the router's custom ko binding handler.
- */
- install(): void;
- }
+ /**
+ * Cancels the subscription.
+ * @chainable
+ */
+ off(): DurandalEventSubscription;
}
+
+interface DurandalEventSupport {
+ /**
+ * Creates a subscription or registers a callback for the specified event.
+ * @param {string} events One or more events, separated by white space.
+ * @returns {Subscription} A subscription is returned.
+ */
+ on(events: string): DurandalEventSubscription;
+
+ /**
+ * Creates a subscription or registers a callback for the specified event.
+ * @param {string} events One or more events, separated by white space.
+ * @param {function} [callback] The callback function to invoke when the event is triggered.
+ * @param {object} [context] An object to use as `this` when invoking the `callback`.
+ * @returns {Events} The events object is returned for chaining.
+ */
+ on(events: string, callback: Function, context?: any): T;
+
+ /**
+ * Removes the callbacks for the specified events.
+ * @param {string} [events] One or more events, separated by white space to turn off. If no events are specified, then the callbacks will be removed.
+ * @param {function} [callback] The callback function to remove. If `callback` is not provided, all callbacks for the specified events will be removed.
+ * @param {object} [context] The object that was used as `this`. Callbacks with this context will be removed.
+ * @chainable
+ */
+ off(events: string, callback: Function, context?: any): T;
+
+ /**
+ * Triggers the specified events.
+ * @param {string} [events] One or more events, separated by white space to trigger.
+ * @chainable
+ */
+ trigger(events: string, ...eventArgs: any[]): T;
+
+ /**
+ * Creates a function that will trigger the specified events when called. Simplifies proxying jQuery (or other) events through to the events object.
+ * @param {string} events One or more events, separated by white space to trigger by invoking the returned function.
+ * @returns {function} Calling the function will invoke the previously specified events on the events object.
+ */
+ proxy(events: string): Function;
+}
+
+interface DurandalEventModule {
+ new (): DurandalEventSupport