Skip to content

Commit 4640ceb

Browse files
committed
2 parents 116fe6a + 71207a1 commit 4640ceb

File tree

9 files changed

+305
-69
lines changed

9 files changed

+305
-69
lines changed

angularjs/angular.d.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,16 @@ declare module ng {
537537
directive(directivesMap: any): ICompileProvider;
538538
}
539539

540-
interface ITemplateLinkingFunction {
540+
interface ICloneAttachFunction {
541541
// Let's hint but not force cloneAttachFn's signature
542-
(scope: IScope, cloneAttachFn?: (clonedElement?: JQuery, scope?: IScope) => any): JQuery;
542+
(clonedElement?: JQuery, scope?: IScope): any;
543+
}
544+
545+
interface ITemplateLinkingFunction {
546+
// If the scope is provided, then the cloneAttachFn must be as well.
547+
(scope: IScope, cloneAttachFn: ICloneAttachFunction): JQuery;
548+
// If one argument is provided, then it's assumed to be the cloneAttachFn.
549+
(cloneAttachFn?: ICloneAttachFunction): JQuery;
543550
}
544551

545552
///////////////////////////////////////////////////////////////////////////
@@ -827,4 +834,4 @@ declare module ng {
827834
}
828835

829836
}
830-
}
837+
}

d3/d3.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,6 +2442,7 @@ declare module D3 {
24422442
(values: any[]): Scale;
24432443
(): any[];
24442444
};
2445+
invertExtent(y: any): any[];
24452446
copy(): Scale;
24462447
}
24472448

jquery/jquery-tests.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,16 @@ function test_data() {
898898
$.data(document.getElementById("id"), "", "8").toUpperCase();
899899
}
900900

901+
function test_removeData() {
902+
$("span:eq(0)").text("" + $("div").data("test1"));
903+
$("div").data("test1", "VALUE-1");
904+
$("div").data("test2", "VALUE-2");
905+
$("span:eq(1)").text("" + $("div").data("test1"));
906+
$("div").removeData("test1");
907+
$("span:eq(2)").text("" + $("div").data("test1"));
908+
$("span:eq(3)").text("" + $("div").data("test2"));
909+
}
910+
901911
function test_dblclick() {
902912
$('#target').dblclick(function () {
903913
alert('Handler for .dblclick() called.');
@@ -1814,6 +1824,20 @@ function test_outerWidth() {
18141824
" , outerWidth( true ):" + p.outerWidth(true));
18151825
}
18161826

1827+
function test_scrollLeft() {
1828+
var p = $("p:first");
1829+
$("p:last").text("scrollLeft:" + p.scrollLeft());
1830+
1831+
$("div.demo").scrollLeft(300);
1832+
}
1833+
1834+
function test_scrollTop() {
1835+
var p = $("p:first");
1836+
$("p:last").text("scrollTop:" + p.scrollTop());
1837+
1838+
$("div.demo").scrollTop(300);
1839+
}
1840+
18171841
function test_position() {
18181842
var p = $("p:first");
18191843
var position = p.position();
@@ -1832,6 +1856,39 @@ function test_insertBefore() {
18321856
$("p").insertBefore("#foo");
18331857
}
18341858

1859+
function test_promise() {
1860+
var div = $("<div>");
1861+
1862+
div.promise().done(function (arg1) {
1863+
// Will fire right away and alert "true"
1864+
alert(this === div && arg1 === div);
1865+
});
1866+
1867+
$("button").on("click", function () {
1868+
$("p").append("Started...");
1869+
1870+
$("div").each(function (i) {
1871+
$(this).fadeIn().fadeOut(1000 * (i + 1));
1872+
});
1873+
1874+
$("div").promise().done(function () {
1875+
$("p").append(" Finished! ");
1876+
});
1877+
});
1878+
1879+
var effect = function () {
1880+
return $("div").fadeIn(800).delay(1200).fadeOut();
1881+
};
1882+
1883+
$("button").on("click", function () {
1884+
$("p").append(" Started... ");
1885+
1886+
$.when(effect()).done(function () {
1887+
$("p").append(" Finished! ");
1888+
});
1889+
});
1890+
}
1891+
18351892
function test_is() {
18361893
$("ul").click(function (event) {
18371894
var $target = $(event.target);

jquery/jquery.d.ts

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,10 +1067,26 @@ interface JQuery {
10671067
*/
10681068
position(): JQueryCoordinates;
10691069

1070+
/**
1071+
* Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element.
1072+
*/
10701073
scrollLeft(): number;
1074+
/**
1075+
* Set the current horizontal position of the scroll bar for each of the set of matched elements.
1076+
*
1077+
* @param value An integer indicating the new position to set the scroll bar to.
1078+
*/
10711079
scrollLeft(value: number): JQuery;
10721080

1081+
/**
1082+
* Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element.
1083+
*/
10731084
scrollTop(): number;
1085+
/**
1086+
* Set the current vertical position of the scroll bar for each of the set of matched elements.
1087+
*
1088+
* @param value An integer indicating the new position to set the scroll bar to.
1089+
*/
10741090
scrollTop(value: number): JQuery;
10751091

10761092
/**
@@ -1114,19 +1130,64 @@ interface JQuery {
11141130
*/
11151131
width(func: (index: number, width: number) => string): JQuery;
11161132

1117-
// Data
1133+
/**
1134+
* Remove from the queue all items that have not yet been run.
1135+
*
1136+
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
1137+
*/
11181138
clearQueue(queueName?: string): JQuery;
11191139

1140+
/**
1141+
* Store arbitrary data associated with the matched elements.
1142+
*
1143+
* @param key A string naming the piece of data to set.
1144+
* @param value The new data value; it can be any Javascript type including Array or Object.
1145+
*/
11201146
data(key: string, value: any): JQuery;
1147+
/**
1148+
* Store arbitrary data associated with the matched elements.
1149+
*
1150+
* @param obj An object of key-value pairs of data to update.
1151+
*/
11211152
data(obj: { [key: string]: any; }): JQuery;
1122-
data(key?: string): any;
1153+
/**
1154+
* Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
1155+
*
1156+
* @param key Name of the data stored.
1157+
*/
1158+
data(key: string): any;
1159+
/**
1160+
* Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
1161+
*/
1162+
data(): any;
11231163

1164+
/**
1165+
* Execute the next function on the queue for the matched elements.
1166+
*
1167+
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
1168+
*/
11241169
dequeue(queueName?: string): JQuery;
11251170

1126-
removeData(nameOrList?: any): JQuery;
1171+
/**
1172+
* Remove a previously-stored piece of data.
1173+
*
1174+
* @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete.
1175+
*/
1176+
removeData(name: string): JQuery;
1177+
/**
1178+
* Remove a previously-stored piece of data.
1179+
*
1180+
* @param list An array of strings naming the pieces of data to delete.
1181+
*/
1182+
removeData(list: string[]): JQuery;
11271183

1128-
// Deferred
1129-
promise(type?: any, target?: any): JQueryPromise<any>;
1184+
/**
1185+
* Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
1186+
*
1187+
* @param type The type of queue that needs to be observed. (default: fx)
1188+
* @param target Object onto which the promise methods have to be attached
1189+
*/
1190+
promise(type?: string, target?: Object): JQueryPromise<any>;
11301191

11311192
// Effects
11321193
animate(properties: any, duration?: any, complete?: Function): JQuery;

jqueryui/jqueryui.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ declare module JQueryUI {
185185
title?: string;
186186
width?: any; // number or string
187187
zIndex?: number;
188+
189+
close?: DialogEvent;
188190
}
189191

190192
interface DialogUIParams {
@@ -561,9 +563,15 @@ declare module JQueryUI {
561563
heightStyle?: string;
562564
hide?: any; // boolean, number, string or object
563565
show?: any; // boolean, number, string or object
566+
567+
activate?: TabsEvent;
564568
}
565569

566570
interface TabsUIParams {
571+
newTab: JQuery;
572+
oldTab: JQuery;
573+
newPanel: JQuery;
574+
oldPanel: JQuery;
567575
}
568576

569577
interface TabsEvent {

openlayers/openlayers.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ declare module OpenLayers {
611611
* openlayers.org homepage:
612612
* http://trac.openlayers.org/wiki/SettingZoomLevels
613613
*/
614-
private initResolutions(): void;
614+
initResolutions(): void;
615615

616616
/**
617617
* Method: resolutionsFromScales
@@ -635,7 +635,7 @@ declare module OpenLayers {
635635
* Returns:
636636
* {Array({Number})} Array of resolutions.
637637
*/
638-
private calculateResolutions(props: Object): number[];
638+
calculateResolutions(props: Object): number[];
639639

640640
/**
641641
* APIMethod: getResolution
@@ -760,15 +760,15 @@ declare module OpenLayers {
760760
* Returns:
761761
* {Integer} the z-index of this layer
762762
*/
763-
private getZIndex(): number;
763+
getZIndex(): number;
764764

765765
/**
766766
* Method: setZIndex
767767
*
768768
* Parameters:
769769
* zIndex - {Integer}
770770
*/
771-
private setZIndex(zIndex: number): void;
771+
setZIndex(zIndex: number): void;
772772

773773
/**
774774
* Method: adjustBounds
@@ -781,7 +781,7 @@ declare module OpenLayers {
781781
* Parameters:
782782
* bounds - {<OpenLayers.Bounds>}
783783
*/
784-
private adjustBounds(bounds: Bounds): Bounds;
784+
adjustBounds(bounds: Bounds): Bounds;
785785

786786
static CLASS_NAME: string;
787787
}

restangular/restangular.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Type definitions for Restangular v0.8.0 - 2013-06-03
1+
// Type definitions for Restangular v1.2.2 - 2014-01-10
22
// Project: https://github.com/mgonto/restangular
33
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
44
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -12,6 +12,9 @@ interface Restangular extends RestangularCustom {
1212
all(route: string): RestangularCollection;
1313
copy(fromElement: any): RestangularElement;
1414
withConfig(configurer: (RestangularProvider) => any): Restangular;
15+
restangularizeElement(parent: any, element: any, route: string, collection?, reqParams?): RestangularElement;
16+
restangularizeCollection(parent: any, element: any, route: string): RestangularCollection;
17+
stripRestangular(element: any): any;
1518
}
1619

1720
interface RestangularElement extends Restangular {

0 commit comments

Comments
 (0)