From 1d6c126e8ead25892ded5a32df2e813ffad06905 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 24 Aug 2015 18:06:19 -0700 Subject: [PATCH] Removed inappropriate overloads in 'jquery.gridster' and 'royalslider', fixed JQuery overload for 'data' in 'jquery'. --- jquery.gridster/gridster-tests.ts | 2 +- jquery.gridster/gridster.d.ts | 4 ---- jquery/jquery.d.ts | 12 ++++++------ royalslider/royalslider-tests.ts | 2 +- royalslider/royalslider.d.ts | 2 -- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/jquery.gridster/gridster-tests.ts b/jquery.gridster/gridster-tests.ts index 80c71e5359..3672c9555f 100644 --- a/jquery.gridster/gridster-tests.ts +++ b/jquery.gridster/gridster-tests.ts @@ -16,7 +16,7 @@ var options: GridsterOptions = { } }; -let gridster: Gridster = $('.gridster ul').gridster(options).data('gridster'); +var gridster: Gridster = $('.gridster ul').gridster(options).data('gridster'); gridster.add_widget('
  • The HTML of the widget...
  • ', 2, 1); gridster.remove_widget($('gridster li').eq(3).get(0)); var json = gridster.serialize(); diff --git a/jquery.gridster/gridster.d.ts b/jquery.gridster/gridster.d.ts index abbb4c8e00..e003f0ebcc 100644 --- a/jquery.gridster/gridster.d.ts +++ b/jquery.gridster/gridster.d.ts @@ -248,7 +248,3 @@ interface Gridster { **/ disable(): Gridster; } - -interface JQuery { - data(key: "gridster"): Gridster; -} \ No newline at end of file diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 3599c808fa..ad9e934551 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -1545,18 +1545,18 @@ interface JQuery { * @param value The new data value; it can be any Javascript type including Array or Object. */ data(key: string, value: any): JQuery; - /** - * Store arbitrary data associated with the matched elements. - * - * @param obj An object of key-value pairs of data to update. - */ - data(obj: { [key: string]: any; }): JQuery; /** * 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. * * @param key Name of the data stored. */ data(key: string): any; + /** + * Store arbitrary data associated with the matched elements. + * + * @param obj An object of key-value pairs of data to update. + */ + data(obj: { [key: string]: any; }): JQuery; /** * 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. */ diff --git a/royalslider/royalslider-tests.ts b/royalslider/royalslider-tests.ts index 88e44a6fba..4246ec90b3 100644 --- a/royalslider/royalslider-tests.ts +++ b/royalslider/royalslider-tests.ts @@ -100,7 +100,7 @@ jQuery(document).ready(function () { // Another example: $(".royalSlider").royalSlider('goTo', 3); // But it's recommended to get instance once if you have many calls: -var slider = $(".royalSlider").royalSlider().data('royalSlider'); +var slider: RoyalSlider.RoyalSlider = $(".royalSlider").royalSlider().data('royalSlider'); slider.goTo(3); // go to slide with id slider.next(); // next slide diff --git a/royalslider/royalslider.d.ts b/royalslider/royalslider.d.ts index 3f06b41b58..5dd7c2771f 100644 --- a/royalslider/royalslider.d.ts +++ b/royalslider/royalslider.d.ts @@ -493,6 +493,4 @@ interface JQuery { * @param options The options */ royalSlider(options?: RoyalSlider.RoyalSliderOptions): JQuery; - - data(key: "royalSlider"): RoyalSlider.RoyalSlider; } \ No newline at end of file