Merge remote-tracking branch 'upstream/master'

This commit is contained in:
jraymakers
2014-01-09 15:47:18 -08:00
7 changed files with 108 additions and 15 deletions
+2
View File
@@ -94,6 +94,8 @@ List of Definitions
* [Google Url Shortener](https://developers.google.com/url-shortener/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Hammer.js](http://eightmedia.github.com/hammer.js/) (by [Boris Yankov](https://github.com/borisyankov))
* [Handlebars](http://handlebarsjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [HashSet](http://www.timdown.co.uk/jshashtable/jshashset.html) (by [Sergey Gerasimov](https://github.com/gerich-home))
* [Hashtable](http://www.timdown.co.uk/jshashtable/) (by [Sergey Gerasimov](https://github.com/gerich-home))
* [Highcharts](http://www.highcharts.com/) (by [damianog](https://github.com/damianog))
* [highlight.js](https://github.com/isagalaev/highlight.js) (by [Niklas Mollenhauer](https://github.com/nikeee))
* [History.js](https://github.com/browserstate/history.js) (by [Boris Yankov](https://github.com/borisyankov))
+36
View File
@@ -0,0 +1,36 @@
/// <reference path="hashset.d.ts" />
class Point {
constructor(public x: number, public y: number) {
}
}
function hashPoint(p: Point) {
return "Point:" + p.x + "," + p.y;
}
function pointsEqual(p1: Point, p2: Point) {
return p1.x === p2.x && p1.y === p2.y;
}
var points = new HashSet<Point>({ hashCode: hashPoint, equals: pointsEqual });
points.add(new Point(1, 2));
points.add(new Point(2, 3));
points.add(new Point(1, 2));
points.add(new Point(6, 5));
alert(points.size()); // Alerts 3
var otherPoints = new HashSet<Point>({ hashCode: hashPoint, equals: pointsEqual });
otherPoints.add(new Point(4, 4));
otherPoints.add(new Point(7, 9));
otherPoints.add(new Point(2, 3));
otherPoints.add(new Point(6, 5));
var intersection = points.intersection(otherPoints);
alert(intersection.contains(new Point(2, 3))); // Alerts true
alert(intersection.contains(new Point(7, 9))); // Alerts false
alert(intersection.size()); // Alerts 2
+38
View File
@@ -0,0 +1,38 @@
// Type definitions for jshashset 3.0
// Project: http://www.timdown.co.uk/jshashtable/jshashset.html
// Definitions by: Sergey Gerasimov <https://github.com/gerich-home/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../hashtable/hashtable.d.ts" />
interface IHashSet<TValue>
{
add(value: TValue): void;
addAll(arr: TValue[]): void;
contains(value: TValue): boolean;
clear(): void;
isEmpty(): boolean; values(): TValue[];
remove(value: TValue): void;
size(): number;
clone(): IHashSet<TValue>;
isSubsetOf(set: IHashSet<TValue>): boolean;
intersection(set: IHashSet<TValue>): IHashSet<TValue>;
union(set: IHashSet<TValue>): IHashSet<TValue>;
complement(set: IHashSet<TValue>): IHashSet<TValue>;
}
interface IHashSetStatic {
new <TValue>(): IHashSet<TValue>;
new <TValue>(options: IHashtableOptions<TValue>): IHashSet<TValue>;
new <TValue>(hashCode?: (value: TValue) => any, equals?: (value1: TValue, value2: TValue) => boolean): IHashSet<TValue>;
}
declare var HashSet: IHashSetStatic;
declare module "hashset" {
export = HashSet;
}
+1 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for jshashtable 3.0
// Project: http://www.timdown.co.uk/jshashtable/
// Definitions by: Sergey Gerasimov <https://github.com/gerichhome/>
// Definitions by: Sergey Gerasimov <https://github.com/gerich-home/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface IHashtable<TKey, TValue>
+12 -6
View File
@@ -1802,16 +1802,22 @@ function test_innerWidth() {
function test_outerHeight() {
var p = $("p:first");
$("p:last").text("outerHeight:" + p.outerHeight(true));
p.outerHeight(p.outerHeight() * 2).outerHeight();
p.outerHeight(p.outerHeight() * 2, true).outerHeight();
$("p:last").text(
"outerHeight:" + p.outerHeight() +
" , outerHeight( true ):" + p.outerHeight(true));
}
function test_outerWidth() {
var p = $("p:first");
$("p:last").text("outerWidth:" + p.outerWidth(true));
p.outerWidth(p.outerWidth() * 2).outerWidth();
p.outerWidth(p.outerWidth() * 2, true).outerWidth();
$("p:last").text(
"outerWidth:" + p.outerWidth() +
" , outerWidth( true ):" + p.outerWidth(true));
}
function test_position() {
var p = $("p:first");
var position = p.position();
$("p:last").text("left: " + position.left + ", top: " + position.top);
}
function test_insertAfter() {
+14 -3
View File
@@ -1048,13 +1048,24 @@ interface JQuery {
*/
offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery;
/**
* Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.
*
* @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
*/
outerHeight(includeMargin?: boolean): number;
outerHeight(value: number, includeMargin?: boolean): JQuery;
/**
* Get the current computed width for the first element in the set of matched elements, including padding and border.
*
* @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
*/
outerWidth(includeMargin?: boolean): number;
outerWidth(value: number, includeMargin?: boolean): JQuery;
position(): { top: number; left: number; };
/**
* Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
*/
position(): JQueryCoordinates;
scrollLeft(): number;
scrollLeft(value: number): JQuery;
+5 -5
View File
@@ -611,7 +611,7 @@ declare module OpenLayers {
* openlayers.org homepage:
* http://trac.openlayers.org/wiki/SettingZoomLevels
*/
private initResolutions(): void;
initResolutions(): void;
/**
* Method: resolutionsFromScales
@@ -635,7 +635,7 @@ declare module OpenLayers {
* Returns:
* {Array({Number})} Array of resolutions.
*/
private calculateResolutions(props: Object): number[];
calculateResolutions(props: Object): number[];
/**
* APIMethod: getResolution
@@ -760,7 +760,7 @@ declare module OpenLayers {
* Returns:
* {Integer} the z-index of this layer
*/
private getZIndex(): number;
getZIndex(): number;
/**
* Method: setZIndex
@@ -768,7 +768,7 @@ declare module OpenLayers {
* Parameters:
* zIndex - {Integer}
*/
private setZIndex(zIndex: number): void;
setZIndex(zIndex: number): void;
/**
* Method: adjustBounds
@@ -781,7 +781,7 @@ declare module OpenLayers {
* Parameters:
* bounds - {<OpenLayers.Bounds>}
*/
private adjustBounds(bounds: Bounds): Bounds;
adjustBounds(bounds: Bounds): Bounds;
static CLASS_NAME: string;
}