Skip to content

Commit 38fb591

Browse files
committed
Merge pull request DefinitelyTyped#5346 from DanielRosenwasser/handleExtraObjectLiteralProperties
Handle extra object literal properties (Part III)
2 parents bb45306 + 457db39 commit 38fb591

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+715
-332
lines changed

amplifyjs/amplifyjs.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface amplifyDecoders {
2929

3030
interface amplifyAjaxSettings extends JQueryAjaxSettings {
3131
cache?: any;
32+
dataMap?: {} | ((data: any) => {});
3233
decoder?: any /* string or amplifyDecoder */;
3334
}
3435

angular-ui-bootstrap/angular-ui-bootstrap-tests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ testApp.config((
135135
popupDelay: 1000,
136136
appendToBody: true,
137137
trigger: 'mouseenter hover',
138-
useContentExp: true
138+
useContentExp: true,
139139
});
140140
$tooltipProvider.setTriggers({
141141
'customOpenTrigger': 'customCloseTrigger'

backbone.layoutmanager/backbone.layoutmanager.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ declare module Backbone {
1111

1212
interface LayoutOptions<TModel extends Model> extends ViewOptions<TModel> {
1313
template?: string;
14+
views?: { [viewName: string]: View<TModel> };
1415
}
1516

1617
interface LayoutManagerOptions {

backgrid/backgrid.d.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ declare module Backgrid {
1010
interface GridOptions {
1111
columns: Column[];
1212
collection: Backbone.Collection<Backbone.Model>;
13-
header: Header;
14-
body: Body;
15-
row: Row;
16-
footer: Footer;
13+
header?: Header;
14+
body?: Body;
15+
row?: Row;
16+
footer?: Footer;
1717
}
1818

1919
class Header extends Backbone.View<Backbone.Model> {
@@ -109,6 +109,8 @@ declare module Backgrid {
109109
header: any;
110110
tagName: string;
111111

112+
constructor(options: GridOptions);
113+
112114
initialize(options: any);
113115
getSelectedModels(): Backbone.Model[];
114116
insertColumn(...options: any[]): Grid;

chrome/chrome-tests.ts

-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ function bookmarksExample() {
6060
resizable: false,
6161
height: 140,
6262
modal: true,
63-
overlay: {
64-
backgroundColor: '#000',
65-
opacity: 0.5
66-
},
6763
buttons: {
6864
'Yes, Delete It!': function () {
6965
chrome.bookmarks.remove(String(bookmarkNode.id));

ckeditor/ckeditor-tests.ts

-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ function test_adding_dialog_by_definition() {
282282

283283
function test_adding_plugin() {
284284
CKEDITOR.plugins.add( 'abbr', {
285-
icons: 'abbr',
286285
init: function( editor: CKEDITOR.editor ) {
287286
// empty logic
288287
}

ckeditor/ckeditor.d.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ declare module CKEDITOR {
628628
data: Function;
629629
defaults: Object;
630630
dialog: String;
631-
downcast: any; // should be string | Function
631+
downcast: string | Function;
632632
downcasts: Object;
633633
draggable: boolean;
634634
editables: Object;
@@ -643,16 +643,16 @@ declare module CKEDITOR {
643643
styleToAllowedContentRules: Function;
644644
styleableElements: string;
645645
template: string;
646-
upcast: any; // should be string | Function
646+
upcast: string | Function;
647647
upcasts: Object;
648648

649649
addClass(className: string): void;
650650
applyStyle(style: any): void; // any should be CKEDITOR.style
651651
capture(): void;
652652
checkStyleActive(style: any): boolean; // any should be CKEDITOR.style
653-
define(name: string, meta: {errorProof?: boolean}): void;
653+
define(name: string, meta: { errorProof?: boolean }): void;
654654
destroy(offline?: boolean): void;
655-
destroyEditable(editableName:string, offline?: boolean): void;
655+
destroyEditable(editableName: string, offline?: boolean): void;
656656
edit(): boolean;
657657
fire(eventName: string, data?: Object, editor?: editor): any; // should be boolean | Object
658658
fireOnce(eventName: string, data?: Object, editor?: editor): any; // should be boolean | Object
@@ -670,7 +670,7 @@ declare module CKEDITOR {
670670
removeClass(className: string): void;
671671
removeListener(evnetName: string, listenerFunction: Function): void;
672672
removeStyle(style: any): void; // any should be CKEDITOR.style
673-
setData(keyOrData: any, value?: Object): IWidget; // any should be string | Object
673+
setData(keyOrData: string | {}, value?: Object): IWidget;
674674
setFocused(selected: boolean): IWidget;
675675
setSelected(selected: boolean): IWidget;
676676
toFeature(): any; // should be CKEDITOR.feature
@@ -685,7 +685,7 @@ declare module CKEDITOR {
685685
data?: Function;
686686
defaults?: Object;
687687
dialog?: String;
688-
downcast?: any; // should be string | Function
688+
downcast?: string | Function;
689689
downcasts?: Object;
690690
draggable?: boolean;
691691
edit?: Function;
@@ -701,7 +701,7 @@ declare module CKEDITOR {
701701
styleToAllowedContentRules?: Function;
702702
styleableElements?: string;
703703
template?: string;
704-
upcast?: any; // should be string | Function
704+
upcast?: string | Function;
705705
upcasts?: Object;
706706
toFeature?(): any; // should be CKEDITOR.feature
707707
}
@@ -732,8 +732,8 @@ declare module CKEDITOR {
732732

733733
interface IPluginDefinition {
734734
hidpi?: boolean;
735-
lang?: any; // should be string | string[]
736-
requires?: any; // should be string | string[]a
735+
lang?: string | string[];
736+
requires?: string | string[];
737737
afterInit?(editor: editor): any;
738738
beforeInit?(editor: editor): any;
739739
init?(editor: editor): any;

cryptojs/cryptojs.d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ declare module CryptoJS{
127127
//BlockCipher has interface same as IStreamCipher
128128
interface BlockCipher extends IStreamCipher<IBlockCipherCfg>{}
129129

130-
interface IBlockCipherCfg{
130+
interface IBlockCipherCfg {
131131
mode?: mode.IBlockCipherModeImpl //default CBC
132132
padding?: pad.IPaddingImpl //default Pkcs7
133133
}
134134

135-
interface CipherParamsData{
135+
interface CipherParamsData {
136136
ciphertext?: lib.WordArray
137137
key?: lib.WordArray
138138
iv?: lib.WordArray
@@ -277,8 +277,8 @@ declare module CryptoJS{
277277
encryptBlock(M: number[], offset: number): void
278278
decryptBlock(M: number[], offset: number): void
279279

280-
createEncryptor(key: lib.WordArray, cfg?: lib.IBlockCipherCfg): IBlockCipherImpl
281-
createDecryptor(key: lib.WordArray, cfg?: lib.IBlockCipherCfg): IBlockCipherImpl
280+
createEncryptor(key: lib.WordArray, cfg?: lib.CipherParamsData): IBlockCipherImpl
281+
createDecryptor(key: lib.WordArray, cfg?: lib.CipherParamsData): IBlockCipherImpl
282282

283283
create(xformMode?: number, key?: lib.WordArray, cfg?: lib.IBlockCipherCfg): IBlockCipherImpl
284284
}

d3/d3-tests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ module forcedBasedLabelPlacemant {
922922

923923
var nodes: Node[] = [];
924924
var labelAnchors: LabelAnchor[] = [];
925-
var labelAnchorLinks: { source: number; target: number }[] = [];
925+
var labelAnchorLinks: { source: number; target: number; weight: number }[] = [];
926926
var links: typeof labelAnchorLinks = [];
927927

928928
for (var i = 0; i < 30; i++) {

donna/donna.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ declare module DonnaTypes {
2525
type: string;
2626
name: string;
2727
bindingType: string;
28+
paramNames?: string[];
2829
classProperties?: any[];
2930
prototypeProperties?: number[][];
3031
doc?: string;

drop/drop.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ declare module drop {
2222
content?: Element | string | ((drop?: Drop) => string) | ((drop?: Drop) => Element);
2323
position?: string;
2424
openOn?: string;
25+
classes?: string;
2526
constrainToWindow?: boolean;
2627
constrainToScrollParent?: boolean;
2728
remove?: boolean;

ember/ember.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ interface CoreObjectArguments {
349349
Override to implement teardown.
350350
**/
351351
willDestroy?: Function;
352+
353+
[propName: string]: any;
352354
}
353355

354356
interface EnumerableConfigurationOptions {
@@ -998,7 +1000,7 @@ declare module Ember {
9981000
@static
9991001
@param {Object} [args] - Object containing values to use within the new class
10001002
**/
1001-
static extend<T>(args ?: CoreObjectArguments): T;
1003+
static extend<T>(args?: CoreObjectArguments): T;
10021004
/**
10031005
Creates a new subclass.
10041006
@method extend

famous/famous.d.ts

+6
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,13 @@ declare module "famous/dom-renderables" {
125125
}
126126

127127
export interface IDOMElementOptions {
128+
tagName?: string;
129+
classes?: string[];
130+
attributes?: { [attributeName: string]: string };
131+
properties?: { [attributeName: string]: string };
132+
id?: string;
128133
content?: string;
134+
cutout?: boolean;
129135
}
130136
}
131137

fancybox/fancybox-tests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ $(".fancybox").fancybox({
116116
}
117117
});
118118
$(".fancybox").fancybox({
119-
beforeLoad: function () {
119+
beforeLoad: () => {
120120
this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
121121
}
122122
});

fancybox/fancybox.d.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
/// <reference path="../jquery/jquery.d.ts" />
88

9-
interface FancyboxOptions {
9+
interface FancyboxOptions extends FancyboxCallback {
1010
padding?: any; // number or []
1111
margin?: any; // number or []
1212
width?: any; // number or []
@@ -96,16 +96,16 @@ interface FancyboxMethods {
9696
}
9797

9898
interface FancyboxCallback {
99-
onCancel;
100-
beforeLoad;
101-
afterLoad;
102-
beforeShow;
103-
afterShow;
104-
beforeClose;
105-
afterClose;
106-
onUpdate;
107-
onPlayStart;
108-
onPlayEnd;
99+
onCancel?: Function;
100+
beforeLoad?: Function;
101+
afterLoad?: Function;
102+
beforeShow?: Function;
103+
afterShow?: Function;
104+
beforeClose?: Function;
105+
afterClose?: Function;
106+
onUpdate?: Function;
107+
onPlayStart?: Function;
108+
onPlayEnd?: Function;
109109
}
110110

111111
interface FancyboxThumbnailHelperOptions {

fullCalendar/fullCalendar-tests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ $('#calendar').fullCalendar({
6767
$('#calendar').fullCalendar('option', 'aspectRatio', 1.8);
6868

6969
$('#calendar').fullCalendar({
70-
viewDisplay: function (view) {
70+
viewRender: function(view) {
7171
alert('The new title of the view is ' + view.title);
7272
}
7373
});

gulp-sourcemaps/gulp-sourcemaps.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ declare module "gulp-sourcemaps" {
1717

1818
interface WriteOptions {
1919
addComment?: boolean;
20-
includeContext?: boolean;
20+
includeContent?: boolean;
2121
sourceRoot?: string | WriteMapper;
2222
sourceMappingURLPrefix?: string | WriteMapper;
2323
}
2424

2525
export function init(opts?: InitOptions): NodeJS.ReadWriteStream;
26-
export function write(opts?: WriteOptions): NodeJS.ReadWriteStream;
2726
export function write(path?: string, opts?: WriteOptions): NodeJS.ReadWriteStream;
27+
export function write(opts?: WriteOptions): NodeJS.ReadWriteStream;
2828
}

hammerjs/hammerjs-1.1.3-tests.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ $("#element")
4343
});
4444

4545
$("#container").hammer({
46-
prevent_default: false,
47-
drag_block_vertical: false
46+
preventDefault: false,
47+
dragBlockVertical: false
4848
}).on("hold tap doubletap transformstart transform transformend dragstart drag dragend release swipe", function (ev) {
4949
});

highcharts/highcharts-tests.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ var chart2 = new Highcharts.Chart({
112112
});
113113

114114
chart1.exportChart(null, {
115-
chart: {
116-
backgroundColor: '#FFFFFF'
117-
}
115+
backgroundColor: '#FFFFFF'
118116
});
119117

120118

highcharts/highstock.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface HighstockNavigatorOptions {
1414
baseSeries?: string | number;
1515
enabled?: boolean;
1616
handles?: {
17-
backgoundColor?: string;
17+
backgroundColor?: string;
1818
borderColor?: string;
1919
};
2020
height?: number;

joi/joi-tests.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,8 @@ whenOpts = {is: schema, otherwise: schema};
107107

108108
var refOpts: Joi.ReferenceOptions = null;
109109

110-
refOpts = {alias: bool};
111-
refOpts = {multiple: bool};
112-
refOpts = {override: bool};
110+
refOpts = {separator: str};
111+
refOpts = {contextPrefix: str};
113112

114113
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
115114

jqrangeslider/jqrangeslider.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ interface JQuery {
7070
dateRangeSlider(method: string): any;
7171
dateRangeSlider(method: string, value: Date): JQuery;
7272
dateRangeSlider(method: string, min: Date, max: Date): JQuery
73-
dateRangeSlider(options?: JQRangeSliderOptions): JQuery;
73+
dateRangeSlider(options?: JQDateRangeSliderOptions): JQuery;
7474
}

jquery-jsonrpcclient/jquery-jsonrpcclient.d.ts

+12-6
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@
66
/// <reference path="../jquery/jquery.d.ts" />
77

88
interface JsonRpcClientOptions extends JQueryAjaxSettings {
9-
ajaxUrl?: string;
9+
ajaxUrl: string;
1010
headers?: {[key:string]: any};
11-
sockerUrl?: string;
12-
onmessage?: () => void;
13-
onopen?: () => void;
14-
onclose?: () => void;
15-
onerror?: () => void;
11+
socketUrl?: string;
12+
onmessage?: (ev: MessageEvent) => void;
13+
onopen?: (ev: Event) => void;
14+
onclose?: (ev: CloseEvent) => void;
15+
onerror?: (ev: Event) => void;
1616
getSockect?: (onmessageCb: () => void) => WebSocket;
17+
18+
/**
19+
* Sets timeout for calls in milliseconds.
20+
* Works with WebSocket as well as AJAX.
21+
*/
22+
timeout?: number;
1723
}
1824

1925
interface JsonRpcClient {

jquery-sortable/jquery-sortable.d.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,16 @@ declare module JQuerySortable {
8888
}
8989

9090
interface Options extends GroupOptions, ContainerOptions {
91+
group?: string;
9192
}
9293
}
9394

94-
9595
interface JQuery {
96-
sortable(options?: JQuerySortable.Options): JQuery;
97-
9896
sortable(methodName: 'enable'): JQuery;
9997
sortable(methodName: 'disable'): JQuery;
10098
sortable(methodName: 'refresh'): JQuery;
10199
sortable(methodName: 'destroy'): JQuery;
102100
sortable(methodName: 'serialize'): JQuery;
103101
sortable(methodName: string): JQuery;
102+
sortable(options?: JQuerySortable.Options): JQuery;
104103
}

jquery.colorpicker/jquery.colorpicker.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ interface JQueryStatic {
154154
}
155155

156156
interface JQuery {
157-
colorpicker(options?: JQueryColorpickerOptions): JQuery;
158-
colorpicker(method: string): JQuery;
159-
colorpicker(method: string, param: any): JQuery;
160157
colorpicker(method: "close"): JQuery;
161158
colorpicker(method: "destroy"): JQuery;
162159
colorpicker(method: "open"): JQuery;
160+
colorpicker(method: string): JQuery;
163161
colorpicker(method: "setColor", color: any): JQuery;
162+
colorpicker(method: string, param: any): JQuery;
163+
colorpicker(options?: JQueryColorpickerOptions): JQuery;
164164
}

0 commit comments

Comments
 (0)