diff --git a/amplifyjs/amplifyjs.d.ts b/amplifyjs/amplifyjs.d.ts index 30e827294..961d815c6 100644 --- a/amplifyjs/amplifyjs.d.ts +++ b/amplifyjs/amplifyjs.d.ts @@ -29,6 +29,7 @@ interface amplifyDecoders { interface amplifyAjaxSettings extends JQueryAjaxSettings { cache?: any; + dataMap?: {} | ((data: any) => {}); decoder?: any /* string or amplifyDecoder */; } diff --git a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index efb63d006..7851d2da3 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -135,7 +135,7 @@ testApp.config(( popupDelay: 1000, appendToBody: true, trigger: 'mouseenter hover', - useContentExp: true + useContentExp: true, }); $tooltipProvider.setTriggers({ 'customOpenTrigger': 'customCloseTrigger' diff --git a/backbone.layoutmanager/backbone.layoutmanager.d.ts b/backbone.layoutmanager/backbone.layoutmanager.d.ts index 6c830d0ba..5ce548157 100644 --- a/backbone.layoutmanager/backbone.layoutmanager.d.ts +++ b/backbone.layoutmanager/backbone.layoutmanager.d.ts @@ -11,6 +11,7 @@ declare module Backbone { interface LayoutOptions extends ViewOptions { template?: string; + views?: { [viewName: string]: View }; } interface LayoutManagerOptions { diff --git a/backgrid/backgrid.d.ts b/backgrid/backgrid.d.ts index 3a75e6142..d0ddc3e51 100644 --- a/backgrid/backgrid.d.ts +++ b/backgrid/backgrid.d.ts @@ -10,10 +10,10 @@ declare module Backgrid { interface GridOptions { columns: Column[]; collection: Backbone.Collection; - header: Header; - body: Body; - row: Row; - footer: Footer; + header?: Header; + body?: Body; + row?: Row; + footer?: Footer; } class Header extends Backbone.View { @@ -109,6 +109,8 @@ declare module Backgrid { header: any; tagName: string; + constructor(options: GridOptions); + initialize(options: any); getSelectedModels(): Backbone.Model[]; insertColumn(...options: any[]): Grid; diff --git a/chrome/chrome-tests.ts b/chrome/chrome-tests.ts index cbbe93791..f4e208d89 100644 --- a/chrome/chrome-tests.ts +++ b/chrome/chrome-tests.ts @@ -60,10 +60,6 @@ function bookmarksExample() { resizable: false, height: 140, modal: true, - overlay: { - backgroundColor: '#000', - opacity: 0.5 - }, buttons: { 'Yes, Delete It!': function () { chrome.bookmarks.remove(String(bookmarkNode.id)); diff --git a/ckeditor/ckeditor-tests.ts b/ckeditor/ckeditor-tests.ts index aa052b8ee..f7deb6706 100644 --- a/ckeditor/ckeditor-tests.ts +++ b/ckeditor/ckeditor-tests.ts @@ -282,7 +282,6 @@ function test_adding_dialog_by_definition() { function test_adding_plugin() { CKEDITOR.plugins.add( 'abbr', { - icons: 'abbr', init: function( editor: CKEDITOR.editor ) { // empty logic } diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index 315f9bdf1..3bb90c760 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -628,7 +628,7 @@ declare module CKEDITOR { data: Function; defaults: Object; dialog: String; - downcast: any; // should be string | Function + downcast: string | Function; downcasts: Object; draggable: boolean; editables: Object; @@ -643,16 +643,16 @@ declare module CKEDITOR { styleToAllowedContentRules: Function; styleableElements: string; template: string; - upcast: any; // should be string | Function + upcast: string | Function; upcasts: Object; addClass(className: string): void; applyStyle(style: any): void; // any should be CKEDITOR.style capture(): void; checkStyleActive(style: any): boolean; // any should be CKEDITOR.style - define(name: string, meta: {errorProof?: boolean}): void; + define(name: string, meta: { errorProof?: boolean }): void; destroy(offline?: boolean): void; - destroyEditable(editableName:string, offline?: boolean): void; + destroyEditable(editableName: string, offline?: boolean): void; edit(): boolean; fire(eventName: string, data?: Object, editor?: editor): any; // should be boolean | Object fireOnce(eventName: string, data?: Object, editor?: editor): any; // should be boolean | Object @@ -670,7 +670,7 @@ declare module CKEDITOR { removeClass(className: string): void; removeListener(evnetName: string, listenerFunction: Function): void; removeStyle(style: any): void; // any should be CKEDITOR.style - setData(keyOrData: any, value?: Object): IWidget; // any should be string | Object + setData(keyOrData: string | {}, value?: Object): IWidget; setFocused(selected: boolean): IWidget; setSelected(selected: boolean): IWidget; toFeature(): any; // should be CKEDITOR.feature @@ -685,7 +685,7 @@ declare module CKEDITOR { data?: Function; defaults?: Object; dialog?: String; - downcast?: any; // should be string | Function + downcast?: string | Function; downcasts?: Object; draggable?: boolean; edit?: Function; @@ -701,7 +701,7 @@ declare module CKEDITOR { styleToAllowedContentRules?: Function; styleableElements?: string; template?: string; - upcast?: any; // should be string | Function + upcast?: string | Function; upcasts?: Object; toFeature?(): any; // should be CKEDITOR.feature } @@ -732,8 +732,8 @@ declare module CKEDITOR { interface IPluginDefinition { hidpi?: boolean; - lang?: any; // should be string | string[] - requires?: any; // should be string | string[]a + lang?: string | string[]; + requires?: string | string[]; afterInit?(editor: editor): any; beforeInit?(editor: editor): any; init?(editor: editor): any; diff --git a/cryptojs/cryptojs.d.ts b/cryptojs/cryptojs.d.ts index d9c77dbe9..a764ebada 100644 --- a/cryptojs/cryptojs.d.ts +++ b/cryptojs/cryptojs.d.ts @@ -127,12 +127,12 @@ declare module CryptoJS{ //BlockCipher has interface same as IStreamCipher interface BlockCipher extends IStreamCipher{} - interface IBlockCipherCfg{ + interface IBlockCipherCfg { mode?: mode.IBlockCipherModeImpl //default CBC padding?: pad.IPaddingImpl //default Pkcs7 } - interface CipherParamsData{ + interface CipherParamsData { ciphertext?: lib.WordArray key?: lib.WordArray iv?: lib.WordArray @@ -277,8 +277,8 @@ declare module CryptoJS{ encryptBlock(M: number[], offset: number): void decryptBlock(M: number[], offset: number): void - createEncryptor(key: lib.WordArray, cfg?: lib.IBlockCipherCfg): IBlockCipherImpl - createDecryptor(key: lib.WordArray, cfg?: lib.IBlockCipherCfg): IBlockCipherImpl + createEncryptor(key: lib.WordArray, cfg?: lib.CipherParamsData): IBlockCipherImpl + createDecryptor(key: lib.WordArray, cfg?: lib.CipherParamsData): IBlockCipherImpl create(xformMode?: number, key?: lib.WordArray, cfg?: lib.IBlockCipherCfg): IBlockCipherImpl } diff --git a/d3/d3-tests.ts b/d3/d3-tests.ts index d087c7876..105e8f29c 100644 --- a/d3/d3-tests.ts +++ b/d3/d3-tests.ts @@ -922,7 +922,7 @@ module forcedBasedLabelPlacemant { var nodes: Node[] = []; var labelAnchors: LabelAnchor[] = []; - var labelAnchorLinks: { source: number; target: number }[] = []; + var labelAnchorLinks: { source: number; target: number; weight: number }[] = []; var links: typeof labelAnchorLinks = []; for (var i = 0; i < 30; i++) { diff --git a/donna/donna.d.ts b/donna/donna.d.ts index fed09fa98..c953764d1 100644 --- a/donna/donna.d.ts +++ b/donna/donna.d.ts @@ -25,6 +25,7 @@ declare module DonnaTypes { type: string; name: string; bindingType: string; + paramNames?: string[]; classProperties?: any[]; prototypeProperties?: number[][]; doc?: string; diff --git a/drop/drop.d.ts b/drop/drop.d.ts index 85cfd0766..a48cb8fb3 100644 --- a/drop/drop.d.ts +++ b/drop/drop.d.ts @@ -22,6 +22,7 @@ declare module drop { content?: Element | string | ((drop?: Drop) => string) | ((drop?: Drop) => Element); position?: string; openOn?: string; + classes?: string; constrainToWindow?: boolean; constrainToScrollParent?: boolean; remove?: boolean; diff --git a/ember/ember.d.ts b/ember/ember.d.ts index 00ea077dd..6a28a80fe 100644 --- a/ember/ember.d.ts +++ b/ember/ember.d.ts @@ -349,6 +349,8 @@ interface CoreObjectArguments { Override to implement teardown. **/ willDestroy?: Function; + + [propName: string]: any; } interface EnumerableConfigurationOptions { @@ -998,7 +1000,7 @@ declare module Ember { @static @param {Object} [args] - Object containing values to use within the new class **/ - static extend(args ?: CoreObjectArguments): T; + static extend(args?: CoreObjectArguments): T; /** Creates a new subclass. @method extend diff --git a/famous/famous.d.ts b/famous/famous.d.ts index 8b05774d8..a02ac86f0 100644 --- a/famous/famous.d.ts +++ b/famous/famous.d.ts @@ -125,7 +125,13 @@ declare module "famous/dom-renderables" { } export interface IDOMElementOptions { + tagName?: string; + classes?: string[]; + attributes?: { [attributeName: string]: string }; + properties?: { [attributeName: string]: string }; + id?: string; content?: string; + cutout?: boolean; } } diff --git a/fancybox/fancybox-tests.ts b/fancybox/fancybox-tests.ts index dce30bf43..d84a06815 100644 --- a/fancybox/fancybox-tests.ts +++ b/fancybox/fancybox-tests.ts @@ -116,7 +116,7 @@ $(".fancybox").fancybox({ } }); $(".fancybox").fancybox({ - beforeLoad: function () { + beforeLoad: () => { this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); } }); diff --git a/fancybox/fancybox.d.ts b/fancybox/fancybox.d.ts index 03a20bebf..7182f7cad 100644 --- a/fancybox/fancybox.d.ts +++ b/fancybox/fancybox.d.ts @@ -6,7 +6,7 @@ /// -interface FancyboxOptions { +interface FancyboxOptions extends FancyboxCallback { padding?: any; // number or [] margin?: any; // number or [] width?: any; // number or [] @@ -96,16 +96,16 @@ interface FancyboxMethods { } interface FancyboxCallback { - onCancel; - beforeLoad; - afterLoad; - beforeShow; - afterShow; - beforeClose; - afterClose; - onUpdate; - onPlayStart; - onPlayEnd; + onCancel?: Function; + beforeLoad?: Function; + afterLoad?: Function; + beforeShow?: Function; + afterShow?: Function; + beforeClose?: Function; + afterClose?: Function; + onUpdate?: Function; + onPlayStart?: Function; + onPlayEnd?: Function; } interface FancyboxThumbnailHelperOptions { diff --git a/fullCalendar/fullCalendar-tests.ts b/fullCalendar/fullCalendar-tests.ts index e7c01a27e..6890cbe42 100644 --- a/fullCalendar/fullCalendar-tests.ts +++ b/fullCalendar/fullCalendar-tests.ts @@ -67,7 +67,7 @@ $('#calendar').fullCalendar({ $('#calendar').fullCalendar('option', 'aspectRatio', 1.8); $('#calendar').fullCalendar({ - viewDisplay: function (view) { + viewRender: function(view) { alert('The new title of the view is ' + view.title); } }); diff --git a/gulp-sourcemaps/gulp-sourcemaps.d.ts b/gulp-sourcemaps/gulp-sourcemaps.d.ts index 220085367..56cb957e1 100644 --- a/gulp-sourcemaps/gulp-sourcemaps.d.ts +++ b/gulp-sourcemaps/gulp-sourcemaps.d.ts @@ -17,12 +17,12 @@ declare module "gulp-sourcemaps" { interface WriteOptions { addComment?: boolean; - includeContext?: boolean; + includeContent?: boolean; sourceRoot?: string | WriteMapper; sourceMappingURLPrefix?: string | WriteMapper; } export function init(opts?: InitOptions): NodeJS.ReadWriteStream; - export function write(opts?: WriteOptions): NodeJS.ReadWriteStream; export function write(path?: string, opts?: WriteOptions): NodeJS.ReadWriteStream; + export function write(opts?: WriteOptions): NodeJS.ReadWriteStream; } \ No newline at end of file diff --git a/hammerjs/hammerjs-1.1.3-tests.ts b/hammerjs/hammerjs-1.1.3-tests.ts index 42c5ccea3..5515175af 100644 --- a/hammerjs/hammerjs-1.1.3-tests.ts +++ b/hammerjs/hammerjs-1.1.3-tests.ts @@ -43,7 +43,7 @@ $("#element") }); $("#container").hammer({ - prevent_default: false, - drag_block_vertical: false + preventDefault: false, + dragBlockVertical: false }).on("hold tap doubletap transformstart transform transformend dragstart drag dragend release swipe", function (ev) { }); \ No newline at end of file diff --git a/highcharts/highcharts-tests.ts b/highcharts/highcharts-tests.ts index 9918df953..f163f2a30 100644 --- a/highcharts/highcharts-tests.ts +++ b/highcharts/highcharts-tests.ts @@ -112,9 +112,7 @@ var chart2 = new Highcharts.Chart({ }); chart1.exportChart(null, { - chart: { - backgroundColor: '#FFFFFF' - } + backgroundColor: '#FFFFFF' }); diff --git a/highcharts/highstock.d.ts b/highcharts/highstock.d.ts index 162d15655..5f59e3694 100644 --- a/highcharts/highstock.d.ts +++ b/highcharts/highstock.d.ts @@ -14,7 +14,7 @@ interface HighstockNavigatorOptions { baseSeries?: string | number; enabled?: boolean; handles?: { - backgoundColor?: string; + backgroundColor?: string; borderColor?: string; }; height?: number; diff --git a/joi/joi-tests.ts b/joi/joi-tests.ts index fc1f8ef25..9e631e3e3 100644 --- a/joi/joi-tests.ts +++ b/joi/joi-tests.ts @@ -107,9 +107,8 @@ whenOpts = {is: schema, otherwise: schema}; var refOpts: Joi.ReferenceOptions = null; -refOpts = {alias: bool}; -refOpts = {multiple: bool}; -refOpts = {override: bool}; +refOpts = {separator: str}; +refOpts = {contextPrefix: str}; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- diff --git a/jqrangeslider/jqrangeslider.d.ts b/jqrangeslider/jqrangeslider.d.ts index b41df43c0..58934e776 100644 --- a/jqrangeslider/jqrangeslider.d.ts +++ b/jqrangeslider/jqrangeslider.d.ts @@ -70,5 +70,5 @@ interface JQuery { dateRangeSlider(method: string): any; dateRangeSlider(method: string, value: Date): JQuery; dateRangeSlider(method: string, min: Date, max: Date): JQuery - dateRangeSlider(options?: JQRangeSliderOptions): JQuery; + dateRangeSlider(options?: JQDateRangeSliderOptions): JQuery; } diff --git a/jquery-jsonrpcclient/jquery-jsonrpcclient.d.ts b/jquery-jsonrpcclient/jquery-jsonrpcclient.d.ts index de008dc09..fd620ba7f 100644 --- a/jquery-jsonrpcclient/jquery-jsonrpcclient.d.ts +++ b/jquery-jsonrpcclient/jquery-jsonrpcclient.d.ts @@ -6,14 +6,20 @@ /// interface JsonRpcClientOptions extends JQueryAjaxSettings { - ajaxUrl?: string; + ajaxUrl: string; headers?: {[key:string]: any}; - sockerUrl?: string; - onmessage?: () => void; - onopen?: () => void; - onclose?: () => void; - onerror?: () => void; + socketUrl?: string; + onmessage?: (ev: MessageEvent) => void; + onopen?: (ev: Event) => void; + onclose?: (ev: CloseEvent) => void; + onerror?: (ev: Event) => void; getSockect?: (onmessageCb: () => void) => WebSocket; + + /** + * Sets timeout for calls in milliseconds. + * Works with WebSocket as well as AJAX. + */ + timeout?: number; } interface JsonRpcClient { diff --git a/jquery-sortable/jquery-sortable.d.ts b/jquery-sortable/jquery-sortable.d.ts index 82f4e8aa0..ce47a5900 100644 --- a/jquery-sortable/jquery-sortable.d.ts +++ b/jquery-sortable/jquery-sortable.d.ts @@ -88,17 +88,16 @@ declare module JQuerySortable { } interface Options extends GroupOptions, ContainerOptions { + group?: string; } } - interface JQuery { - sortable(options?: JQuerySortable.Options): JQuery; - sortable(methodName: 'enable'): JQuery; sortable(methodName: 'disable'): JQuery; sortable(methodName: 'refresh'): JQuery; sortable(methodName: 'destroy'): JQuery; sortable(methodName: 'serialize'): JQuery; sortable(methodName: string): JQuery; + sortable(options?: JQuerySortable.Options): JQuery; } diff --git a/jquery.colorpicker/jquery.colorpicker.d.ts b/jquery.colorpicker/jquery.colorpicker.d.ts index 5c89e4ed0..32f68c1c1 100644 --- a/jquery.colorpicker/jquery.colorpicker.d.ts +++ b/jquery.colorpicker/jquery.colorpicker.d.ts @@ -154,11 +154,11 @@ interface JQueryStatic { } interface JQuery { - colorpicker(options?: JQueryColorpickerOptions): JQuery; - colorpicker(method: string): JQuery; - colorpicker(method: string, param: any): JQuery; colorpicker(method: "close"): JQuery; colorpicker(method: "destroy"): JQuery; colorpicker(method: "open"): JQuery; + colorpicker(method: string): JQuery; colorpicker(method: "setColor", color: any): JQuery; + colorpicker(method: string, param: any): JQuery; + colorpicker(options?: JQueryColorpickerOptions): JQuery; } diff --git a/jquery.fileupload/jquery.fileupload.d.ts b/jquery.fileupload/jquery.fileupload.d.ts index 3774cb6e1..8c9e93737 100644 --- a/jquery.fileupload/jquery.fileupload.d.ts +++ b/jquery.fileupload/jquery.fileupload.d.ts @@ -8,137 +8,193 @@ // Interface options for the plugin interface JQueryFileInputOptions { - // The drop target element(s), by the default the complete document. - // Set to null to disable drag & drop support: + /** + * The type of data that is expected back from the server. + */ + dataType?: string; + + /** + * The drop target element(s), by the default the complete document. + * Set to null to disable drag & drop support: + */ dropZone?: HTMLElement; - // The paste target element(s), by the default the complete document. - // Set to null to disable paste support: + /** + * The paste target element(s), by the default the complete document. + * Set to null to disable paste support: + */ pasteZone?: HTMLElement; - // The file input field(s), that are listened to for change events. - // If undefined, it is set to the file input fields inside - // of the widget element on plugin initialization. - // Set to null to disable the change listener. + /** + * The file input field(s), that are listened to for change events. + * If undefined, it is set to the file input fields inside + * of the widget element on plugin initialization. + * Set to null to disable the change listener. + */ fileInput?: HTMLElement; - // By default, the file input field is replaced with a clone after - // each input field change event. This is required for iframe transport - // queues and allows change events to be fired for the same file - // selection, but can be disabled by setting the following option to false: + /** + * By default, the file input field is replaced with a clone after + * each input field change event. This is required for iframe transport + * queues and allows change events to be fired for the same file + * selection, but can be disabled by setting the following option to false: + */ replaceFileInput?: boolean; - - // The parameter name for the file form data (the request argument name). - // If undefined or empty, the name property of the file input field is - // used, or "files[]" if the file input name property is also empty, - // can be a string or an array of strings: + /** + * The parameter name for the file form data (the request argument name). + * If undefined or empty, the name property of the file input field is + * used, or "files[]" if the file input name property is also empty, + * can be a string or an array of strings: + */ paramName?: any; - // By default, each file of a selection is uploaded using an individual - // request for XHR type uploads. Set to false to upload file - // selections in one request each: + /** + * By default, each file of a selection is uploaded using an individual + * request for XHR type uploads. Set to false to upload file + * selections in one request each: + */ singleFileUploads?: boolean; - // To limit the number of files uploaded with one XHR request, - // set the following option to an integer greater than 0: + /** + * To limit the number of files uploaded with one XHR request, + * set the following option to an integer greater than 0: + */ limitMultiFileUploads?: number; - // The following option limits the number of files uploaded with one - // XHR request to keep the request size under or equal to the defined - // limit in bytes: + /** + * The following option limits the number of files uploaded with one + * XHR request to keep the request size under or equal to the defined + * limit in bytes + */ limitMultiFileUploadSize?: number; - // Multipart file uploads add a number of bytes to each uploaded file, - // therefore the following option adds an overhead for each file used - // in the limitMultiFileUploadSize configuration: + /** + * Multipart file uploads add a number of bytes to each uploaded file, + * therefore the following option adds an overhead for each file used + * in the limitMultiFileUploadSize configuration: + */ limitMultiFileUploadSizeOverhead?: number; - // Set the following option to true to issue all file upload requests - // in a sequential order: + /** + * Set the following option to true to issue all file upload requests + * in a sequential order: + */ sequentialUploads?: boolean; - // To limit the number of concurrent uploads, - // set the following option to an integer greater than 0: + /** + * To limit the number of concurrent uploads, + * set the following option to an integer greater than 0: + */ limitConcurrentUploads?: number; - // Set the following option to true to force iframe transport uploads: + /** + * Set the following option to true to force iframe transport uploads: + */ forceIframeTransport?: boolean; - // Set the following option to the location of a redirect url on the - // origin server, for cross-domain iframe transport uploads: + /** + * Set the following option to the location of a redirect url on the + * origin server, for cross-domain iframe transport uploads: + */ redirect?: string; - // The parameter name for the redirect url, sent as part of the form - // data and set to 'redirect' if this option is empty: + /** + * The parameter name for the redirect url, sent as part of the form + * data and set to 'redirect' if this option is empty: + */ redirectParamName?: string; - // Set the following option to the location of a postMessage window, - // to enable postMessage transport uploads: + /** + * Set the following option to the location of a postMessage window, + * to enable postMessage transport uploads: + */ postMessage?: string; - // By default, XHR file uploads are sent as multipart/form-data. - // The iframe transport is always using multipart/form-data. - // Set to false to enable non-multipart XHR uploads: + /** + * By default, XHR file uploads are sent as multipart/form-data. + * The iframe transport is always using multipart/form-data. + * Set to false to enable non-multipart XHR uploads: + */ multipart?: boolean; - // To upload large files in smaller chunks, set the following option - // to a preferred maximum chunk size. If set to 0, null or undefined, - // or the browser does not support the required Blob API, files will - // be uploaded as a whole. + /** + * To upload large files in smaller chunks, set the following option + * to a preferred maximum chunk size. If set to 0, null or undefined, + * or the browser does not support the required Blob API, files will + * be uploaded as a whole. + */ maxChunkSize?: number; - // When a non-multipart upload or a chunked multipart upload has been - // aborted, this option can be used to resume the upload by setting - // it to the size of the already uploaded bytes. This option is most - // useful when modifying the options object inside of the "add" or - // "send" callbacks, as the options are cloned for each file upload. + /** + * When a non-multipart upload or a chunked multipart upload has been + * aborted, this option can be used to resume the upload by setting + * it to the size of the already uploaded bytes. This option is most + * useful when modifying the options object inside of the "add" or + * "send" callbacks, as the options are cloned for each file upload. + */ uploadedBytes?: number; - // By default, failed (abort or error) file uploads are removed from the - // global progress calculation. Set the following option to false to - // prevent recalculating the global progress data: + /** + * By default, failed (abort or error) file uploads are removed from the + * global progress calculation. Set the following option to false to + * prevent recalculating the global progress data: + */ recalculateProgress?: boolean; - // Interval in milliseconds to calculate and trigger progress events: + /** + * Interval in milliseconds to calculate and trigger progress events: + */ progressInterval?: number; - // Interval in milliseconds to calculate progress bitrate: + /** + * Interval in milliseconds to calculate progress bitrate: + */ bitrateInterval?: number; - // By default, uploads are started automatically when adding files: + /** + * By default, uploads are started automatically when adding files: + */ autoUpload?: boolean; - // Error and info messages: + /** + * Error and info messages: + */ messages?: any; - // Translation function, gets the message key to be translated - // and an object with context specific data as arguments: + /** + * Translation function, gets the message key to be translated + * and an object with context specific data as arguments: + */ i18n?: any; - // Additional form data to be sent along with the file uploads can be set - // using this option, which accepts an array of objects with name and - // value properties, a function returning such an array, a FormData - // object (for XHR file uploads), or a simple object. - // The form of the first fileInput is given as parameter to the function: + /** + * Additional form data to be sent along with the file uploads can be set + * using this option, which accepts an array of objects with name and + * value properties, a function returning such an array, a FormData + * object (for XHR file uploads), or a simple object. + * The form of the first fileInput is given as parameter to the function: + */ formData?: any; - // The add callback is invoked as soon as files are added to the fileupload - // widget (via file input selection, drag & drop, paste or add API call). - // If the singleFileUploads option is enabled, this callback will be - // called once for each file in the selection for XHR file uploads, else - // once for each file selection. - // - // The upload starts when the submit method is invoked on the data parameter. - // The data object contains a files property holding the added files - // and allows you to override plugin options as well as define ajax settings. - // - // Listeners for this callback can also be bound the following way: - // .bind('fileuploadadd', func); - // - // data.submit() returns a Promise object and allows to attach additional - // handlers using jQuery's Deferred callbacks: - // data.submit().done(func).fail(func).always(func); + /** + * The add callback is invoked as soon as files are added to the fileupload + * widget (via file input selection, drag & drop, paste or add API call). + * If the singleFileUploads option is enabled, this callback will be + * called once for each file in the selection for XHR file uploads, else + * once for each file selection. + * + * The upload starts when the submit method is invoked on the data parameter. + * The data object contains a files property holding the added files + * and allows you to override plugin options as well as define ajax settings. + * + * Listeners for this callback can also be bound the following way: + * .bind('fileuploadadd', func); + * + * data.submit() returns a Promise object and allows to attach additional + * handlers using jQuery's Deferred callbacks: + * data.submit().done(func).fail(func).always(func); + */ add?: any; // The plugin options are used as settings object for the ajax calls. diff --git a/jquery.notifyBar/jquery.notifyBar.d.ts b/jquery.notifyBar/jquery.notifyBar.d.ts index 22e012673..bbfb59bc3 100644 --- a/jquery.notifyBar/jquery.notifyBar.d.ts +++ b/jquery.notifyBar/jquery.notifyBar.d.ts @@ -18,6 +18,13 @@ declare module JQueryNotifyBar { */ delay?: number; + /** + * How long this bar will be slided up and down. + * + * Default: "normal" + */ + animationSpeed?: string | number; + /** * Custom jQuery object for notify bar. */ diff --git a/jquery.pjax/jquery.pjax-tests.ts b/jquery.pjax/jquery.pjax-tests.ts index 0df488130..6af27618e 100644 --- a/jquery.pjax/jquery.pjax-tests.ts +++ b/jquery.pjax/jquery.pjax-tests.ts @@ -47,11 +47,15 @@ function test_defauluts() { timeout: 650, push: true, replace: false, + maxCacheLength: 20, + version: $.noop, + scrollTo: 0, type: 'GET', dataType: 'html', - scrollTo: 0, - maxCacheLength: 20, - version: $.noop + container: "#pjax-container", + url: "https://jquery.com/", + target: undefined, + fragment: "#pjax-response", }; } diff --git a/jquery.pjax/jquery.pjax.d.ts b/jquery.pjax/jquery.pjax.d.ts index 1bd465b1e..bc7d39209 100644 --- a/jquery.pjax/jquery.pjax.d.ts +++ b/jquery.pjax/jquery.pjax.d.ts @@ -36,7 +36,28 @@ interface PjaxSettings extends JQueryAjaxSettings { /** * How many requests to cache. Defaults to 20. */ - maxCacheLength?: number; + maxCacheLength?: number; + + /** + * A string or function returning the current pjax version + */ + version?: string | (() => string); + + /** + * Vertical position to scroll to after navigation. + * To avoid changing scroll position, pass false. + */ + scrollTo?: number | boolean; + + /** + * Eventually the relatedTarget value for pjax events. + */ + target?: EventTarget; + + /** + * CSS selector for the fragment to extract from ajax response. + */ + fragment?: string; } interface JQuery { diff --git a/jquery.timepicker/jquery.timepicker.d.ts b/jquery.timepicker/jquery.timepicker.d.ts index 13a6d2e69..398813b9e 100644 --- a/jquery.timepicker/jquery.timepicker.d.ts +++ b/jquery.timepicker/jquery.timepicker.d.ts @@ -7,68 +7,90 @@ /// interface TimePickerHour { - starts?: number; // first displayed hour - ends?: number; // last displayed hour + /** first displayed hour */ starts?: number; + /** last displayed hour */ ends?: number; } interface TimePickerMinutes { - starts?: number; // first displayed minute - ends?: number; // last displayed minute - interval?: number; // interval of displayed minutes + /** first displayed minute */ starts?: number; + /** last displayed minute */ ends?: number; + /** interval of displayed minutes */ interval?: number; } interface TimePickerOptions { - showOn?: string; // 'focus' for popup on focus, - // 'button' for trigger button, or 'both' for either (not yet implemented) - button?: string; // 'button' element that will trigger the timepicker - showAnim?: string; // Name of jQuery animation for popup - showOptions?: any; // Options for enhanced animations - appendText?: string; // Display text following the input box, e.g. showing the format + /** 'focus' for popup on focus, */ showOn?: string; + + /** * 'button' element that will trigger the timepicker. * * "button" for trigger button, or "both" for either (not yet implemented). */ button?: string; + + // Localization + + /** Define the locale text for "Hours" */ + hourText?: string; + + /** Define the locale text for "Minute" */ + minuteText?: string; + + /** Define the locale text for periods. */ + amPmText?: [string, string]; + + /** Name of jQuery animation for popup */ showAnim?: string; + /** Options for enhanced animations */ showOptions?: any; + /** Display text following the input box, e.g. showing the format */ appendText?: string; - beforeShow?: () => any; // Define a callback function executed before the timepicker is shown - onSelect?: (timeText: string, inst: any) => any; // Define a callback function when a hour / minutes is selected - onClose?: (timeText: string, inst: any) => any; // Define a callback function when the timepicker is closed + /** Define a callback function executed before the timepicker is shown */ beforeShow?: () => any; + /** Define a callback function when a hour / minutes is selected */ onSelect?: (timeText: string, inst: any) => any; + /** Define a callback function when the timepicker is closed */ onClose?: (timeText: string, inst: any) => any; + + /** The character to use to separate hours and minutes. */ timeSeparator?: string; + /** The character to use to separate the time from the time period. */ periodSeparator?: string; + /** Define whether or not to show AM/PM with selected time */ showPeriod?: boolean; + /** Show the AM/PM labels on the left of the time picker */ showPeriodLabels?: boolean; + /** Define whether or not to show a leading zero for hours < 10. [true/false] */ showLeadingZero?: boolean; + /** Define whether or not to show a leading zero for minutes < 10. */ showMinutesLeadingZero?: boolean; + /** Selector for an alternate field to store selected time into */ altField?: string; + /** * Used as default time when input field is empty or for inline timePicker * (set to 'now' for the current time, '' for no highlighted time) **/ defaultTime?: string; + /** * Position of the dialog relative to the input. * * See the position utility for more info : http://jqueryui.com/demos/position/ */ myPosition?: string; + /** * Position of the input element to match * * Note : if the position utility is not loaded, the timepicker will attach left top to left bottom * See the position utility for more info : http://jqueryui.com/demos/position/ */ atPosition?: string; - timeSeparator?: string; // The character to use to separate hours and minutes. - periodSeparator?: string; // The character to use to separate the time from the time period. - showPeriod?: boolean; // Define whether or not to show AM/PM with selected time - showPeriodLabels?: boolean; // Show the AM/PM labels on the left of the time picker - showLeadingZero?: boolean; // Define whether or not to show a leading zero for hours < 10. [true/false] - showMinutesLeadingZero?: boolean; // Define whether or not to show a leading zero for minutes < 10. - altField?: string; // Selector for an alternate field to store selected time into - defaultTime?: string; // Used as default time when input field is empty or for inline timePicker - // (set to 'now' for the current time, '' for no highlighted time) - myPosition?: string; // Position of the dialog relative to the input. - // see the position utility for more info : http://jqueryui.com/demos/position/ - atPosition?: string; // Position of the input element to match - // Note : if the position utility is not loaded, the timepicker will attach left top to left bottom //NEW: 2011-02-03 - onHourShow?: () => any; // callback for enabling / disabling on selectable hours ex : function(hour) { return true; } - onMinuteShow?: () => any; // callback for enabling / disabling on time selection ex : function(hour,minute) { return true; } + /** callback for enabling / disabling on selectable hours ex : function(hour) { return true; } */ onHourShow?: () => any; + /** callback for enabling / disabling on time selection ex : function(hour,minute) { return true; } */ onMinuteShow?: () => any; hours?: TimePickerHour; minutes?: TimePickerMinutes; - rows?: number; // number of rows for the input tables, minimum 2, makes more sense if you use multiple of 2 + + /** number of rows for the input tables, minimum 2, makes more sense if you use multiple of 2 */ rows?: number; // 2011-08-05 0.2.4 - showHours?: boolean; // display the hours section of the dialog - showMinutes?: boolean; // display the minute section of the dialog - optionalMinutes?: boolean; // optionally parse inputs of whole hours with minutes omitted + /** display the hours section of the dialog */ showHours?: boolean; + /** display the minute section of the dialog */ showMinutes?: boolean; + /** optionally parse inputs of whole hours with minutes omitted */ optionalMinutes?: boolean; // buttons - showCloseButton?: boolean; // shows an OK button to confirm the edit - showNowButton?: boolean; // Shows the 'now' button - showDeselectButton?: boolean; // Shows the deselect time button + /** shows an OK button to confirm the edit */ showCloseButton?: boolean; + + /** Text for the confirmation button (ok button).*/ + closeButtonText?: string; + + /** Shows the 'now' button */ showNowButton?: boolean; + + /** Text for the 'now' button.*/ + nowButtonText?: string; + + /** Shows the deselect time button */ showDeselectButton?: boolean; + + /** Text for the deselect button */ + deselectButtonText?: string; } interface JQuery { timepicker(): JQuery; - timepicker(options: TimePickerOptions): JQuery; - timepicker(methodName: string): any; timepicker(methodName: 'getTime'): string; timepicker(methodName: 'getTimeAsDate'): Date; timepicker(methodName: 'getHour'): number; timepicker(methodName: 'getMinute'): number; + timepicker(methodName: string): any; timepicker(methodName: string, methodParameter: any): any; timepicker(optionLiteral: string, optionName: string): any; + timepicker(options: TimePickerOptions): JQuery; } diff --git a/jquery.uniform/jquery.uniform.d.ts b/jquery.uniform/jquery.uniform.d.ts index 4b3ff0d0d..d5eee3e47 100644 --- a/jquery.uniform/jquery.uniform.d.ts +++ b/jquery.uniform/jquery.uniform.d.ts @@ -5,7 +5,7 @@ /// -interface UniformOptions { +interface UniformCoreOptions { activeClass?: string; autoHide?: boolean; buttonClass?: string; @@ -22,6 +22,7 @@ interface UniformOptions { hoverClass?: string; idPrefix?: string; inputAddTypeAsClass?: boolean; + inputClass?: string; radioClass?: string; resetDefaultHtml?: string; resetSelector?: any; @@ -33,12 +34,17 @@ interface UniformOptions { useID?: boolean; wrapperClass?: string; } + +interface UniformOptions extends UniformCoreOptions { + [option: string]: any; +} + interface Uniform { (options?: UniformOptions): JQuery; update(elemOrSelector?: any): void; restore(elemOrSelector?: any): void; elements: JQuery[]; - defaults: UniformOptions; + defaults: UniformOptions; } interface JQueryStatic { uniform: Uniform; diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index dc5c4ebb6..3599c808f 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -185,6 +185,10 @@ interface JQueryXHR extends XMLHttpRequest, JQueryPromise { * Property containing the parsed response if the response Content-Type is json */ responseJSON?: any; + /** + * A function to be called if the request fails. + */ + error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void; } /** diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index ef02b40d6..34f1f4b7e 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -769,13 +769,7 @@ function test_autocomplete() { $("#project-icon").attr("src", "images/" + ui.item.icon); return false; } - }) - .data("autocomplete")._renderItem = (ul, item) => { - return $("
  • ") - .data("item.autocomplete", item) - .append("" + item.label + "
    " + item.desc + "
    ") - .appendTo(ul); - }; + }); $("#developer").autocomplete({ source: (request, response) => { @@ -1425,12 +1419,13 @@ function test_dialog() { height: 300, width: 350, modal: true, - buttons: {}, - Cancel: function () { - $(this).dialog("close"); - }, - close: function () { - var $el = $(this).dialog("destroy"); + buttons: { + Cancel: function () { + $(this).dialog("close"); + }, + close: function () { + var $el = $(this).dialog("destroy"); + } } }); $("#dialog-message").dialog({ @@ -1581,7 +1576,7 @@ function test_spinner() { min: 5, max: 2500, step: 25, - start: 1000, + start: function () { return; }, numberFormat: "C" }); $("#spinner").spinner({ @@ -1595,8 +1590,8 @@ function test_spinner() { }); $("#lat, #lng").spinner({ step: .001, - change: 123, - stop: 321 + change() { }, + stop() { }, }); $("#spinner").spinner({ spin: function (event, ui) { @@ -1647,11 +1642,11 @@ function test_tabs() { }); $("#tabs").tabs({ beforeLoad: function (event, ui) { - ui.jqXHR.error(function () { + ui.jqXHR.error = function () { ui.panel.html( "Couldn't load this tab. We'll try to fix this as soon as possible. " + "If this wouldn't be a demo."); - }); + }; } }); $("#tabs").tabs({ @@ -1764,7 +1759,6 @@ function test_effects() { of: $("#parent"), my: $("#my_horizontal").val() + " " + $("#my_vertical").val(), at: $("#at_horizontal").val() + " " + $("#at_vertical").val(), - offset: $("#offset").val(), collision: $("#collision_horizontal").val() + " " + $("#collision_vertical").val() }); $("#toggle").toggle({ effect: "scale", direction: "horizontal" }); diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index 10a4e7159..5cd04f22d 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -43,7 +43,7 @@ declare module JQueryUI { // Autocomplete ////////////////////////////////////////////////// - interface AutocompleteOptions { + interface AutocompleteOptions extends AutocompleteEvents { appendTo?: any; //Selector; autoFocus?: boolean; delay?: number; @@ -54,7 +54,10 @@ declare module JQueryUI { } interface AutocompleteUIParams { - + /** + * The item selected from the menu, if any. Otherwise the property is null + */ + item?: any; } interface AutocompleteEvent { @@ -72,7 +75,7 @@ declare module JQueryUI { select?: AutocompleteEvent; } - interface Autocomplete extends Widget, AutocompleteOptions, AutocompleteEvents { + interface Autocomplete extends Widget, AutocompleteOptions { escapeRegex: (value: string) => string; } @@ -336,15 +339,16 @@ declare module JQueryUI { // Dialog ////////////////////////////////////////////////// - interface DialogOptions { + interface DialogOptions extends DialogEvents { autoOpen?: boolean; - buttons?: any; // object or [] + buttons?: { [buttonText: string]: () => void } | ButtonOptions[]; closeOnEscape?: boolean; closeText?: string; dialogClass?: string; disabled?: boolean; draggable?: boolean; - height?: any; // number or string + height?: number | string; + hide?: boolean | number | string | DialogShowHideOptions; maxHeight?: number; maxWidth?: number; minHeight?: number; @@ -352,7 +356,7 @@ declare module JQueryUI { modal?: boolean; position?: any; // object, string or [] resizable?: boolean; - show?: any; // number, string or object + show?: boolean | number | string | DialogShowHideOptions; stack?: boolean; title?: string; width?: any; // number or string @@ -361,6 +365,13 @@ declare module JQueryUI { close?: DialogEvent; } + interface DialogShowHideOptions { + effect: string; + delay?: number; + duration?: number; + easing?: string; + } + interface DialogUIParams { } @@ -382,7 +393,7 @@ declare module JQueryUI { resizeStop?: DialogEvent; } - interface Dialog extends Widget, DialogOptions, DialogEvents { + interface Dialog extends Widget, DialogOptions { } @@ -398,7 +409,7 @@ declare module JQueryUI { (event: Event, ui: DraggableEventUIParams): void; } - interface DraggableOptions { + interface DraggableOptions extends DraggableEvents { disabled?: boolean; addClasses?: boolean; appendTo?: any; @@ -453,7 +464,7 @@ declare module JQueryUI { (event: Event, ui: DroppableEventUIParam): void; } - interface DroppableOptions { + interface DroppableOptions extends DroppableEvents { disabled?: boolean; accept?: any; activeClass?: string; @@ -472,7 +483,7 @@ declare module JQueryUI { drop?: DroppableEvent; } - interface Droppable extends Widget, DroppableOptions, DroppableEvents { + interface Droppable extends Widget, DroppableOptions { } // Menu ////////////////////////////////////////////////// @@ -529,7 +540,7 @@ declare module JQueryUI { // Resizable ////////////////////////////////////////////////// - interface ResizableOptions { + interface ResizableOptions extends ResizableEvents { alsoResize?: any; // Selector, JQuery or Element animate?: boolean; animateDuration?: any; // number or string @@ -571,13 +582,13 @@ declare module JQueryUI { stop?: ResizableEvent; } - interface Resizable extends Widget, ResizableOptions, ResizableEvents { + interface Resizable extends Widget, ResizableOptions { } // Selectable ////////////////////////////////////////////////// - interface SelectableOptions { + interface SelectableOptions extends SelectableEvents { autoRefresh?: boolean; cancel?: string; delay?: number; @@ -596,12 +607,12 @@ declare module JQueryUI { unselecting? (event: Event, ui: { unselecting: Element; }): void; } - interface Selectable extends Widget, SelectableOptions, SelectableEvents { + interface Selectable extends Widget, SelectableOptions { } // Slider ////////////////////////////////////////////////// - interface SliderOptions { + interface SliderOptions extends SliderEvents { animate?: any; // boolean, string or number disabled?: boolean; max?: number; @@ -631,7 +642,7 @@ declare module JQueryUI { stop?: SliderEvent; } - interface Slider extends Widget, SliderOptions, SliderEvents { + interface Slider extends Widget, SliderOptions { } @@ -652,6 +663,7 @@ declare module JQueryUI { forceHelperSize?: boolean; forcePlaceholderSize?: boolean; grid?: number[]; + helper?: string | ((event: Event, element: Sortable) => Element); handle?: any; // Selector or Element items?: any; // Selector opacity?: number; @@ -699,7 +711,7 @@ declare module JQueryUI { // Spinner ////////////////////////////////////////////////// - interface SpinnerOptions { + interface SpinnerOptions extends SpinnerEvents { culture?: string; disabled?: boolean; icons?: any; @@ -711,26 +723,29 @@ declare module JQueryUI { step?: any; // number or string } - interface SpinnerUIParams { + interface SpinnerUIParam { + value: number; } - interface SpinnerEvent { - (event: Event, ui: SpinnerUIParams): void; + interface SpinnerEvent { + (event: Event, ui: T): void; } interface SpinnerEvents { - spin?: SpinnerEvent; - start?: SpinnerEvent; - stop?: SpinnerEvent; + change?: SpinnerEvent<{}>; + create?: SpinnerEvent<{}>; + spin?: SpinnerEvent; + start?: SpinnerEvent<{}>; + stop?: SpinnerEvent<{}>; } - interface Spinner extends Widget, SpinnerOptions, SpinnerEvents { + interface Spinner extends Widget, SpinnerOptions { } // Tabs ////////////////////////////////////////////////// - interface TabsOptions { + interface TabsOptions extends TabsEvents { active?: any; // boolean or number collapsible?: boolean; disabled?: any; // boolean or [] @@ -738,29 +753,40 @@ declare module JQueryUI { heightStyle?: string; hide?: any; // boolean, number, string or object show?: any; // boolean, number, string or object - - activate?: TabsEvent; } - interface TabsUIParams { + interface TabsActivationUIParams { newTab: JQuery; oldTab: JQuery; newPanel: JQuery; oldPanel: JQuery; } - interface TabsEvent { - (event: Event, ui: TabsUIParams): void; + interface TabsBeforeLoadUIParams { + tab: JQuery; + panel: JQuery; + jqXHR: JQueryXHR; + ajaxSettings: any; + } + + interface TabsCreateOrLoadUIParams { + tab: JQuery; + panel: JQuery; + } + + interface TabsEvent { + (event: Event, ui: UI): void; } interface TabsEvents { - activate?: TabsEvent; - beforeActivate?: TabsEvent; - beforeLoad?: TabsEvent; - load?: TabsEvent; + activate?: TabsEvent; + beforeActivate?: TabsEvent; + beforeLoad?: TabsEvent; + load?: TabsEvent; + create?: TabsEvent; } - interface Tabs extends Widget, TabsOptions, TabsEvents { + interface Tabs extends Widget, TabsOptions { } @@ -798,7 +824,7 @@ declare module JQueryUI { interface EffectOptions { effect: string; easing?: string; - duration: any; + duration?: number; complete: Function; } @@ -1569,29 +1595,32 @@ interface JQuery { droppable(optionLiteral: string, options: JQueryUI.DraggableOptions): any; droppable(optionLiteral: string, optionName: string, optionValue: any): JQuery; - menu(): JQuery; - menu(methodName: 'blur'): void; - menu(methodName: 'collapse', event?: JQueryEventObject): void; - menu(methodName: 'collapseAll', event?: JQueryEventObject, all?: boolean): void; - menu(methodName: 'destroy'): void; - menu(methodName: 'disable'): void; - menu(methodName: 'enable'): void; - menu(methodName: string, event: JQueryEventObject, item: JQuery): void; - menu(methodName: 'focus', event: JQueryEventObject, item: JQuery): void; - menu(methodName: 'isFirstItem'): boolean; - menu(methodName: 'isLastItem'): boolean; - menu(methodName: 'next', event?: JQueryEventObject): void; - menu(methodName: 'nextPage', event?: JQueryEventObject): void; - menu(methodName: 'previous', event?: JQueryEventObject): void; - menu(methodName: 'previousPage', event?: JQueryEventObject): void; - menu(methodName: 'refresh'): void; - menu(methodName: 'select', event?: JQueryEventObject): void; - menu(methodName: 'widget'): JQuery; - menu(methodName: string): JQuery; - menu(options: JQueryUI.MenuOptions): JQuery; - menu(optionLiteral: string, optionName: string): any; - menu(optionLiteral: string, options: JQueryUI.MenuOptions): any; - menu(optionLiteral: string, optionName: string, optionValue: any): JQuery; + menu: { + (): JQuery; + (methodName: 'blur'): void; + (methodName: 'collapse', event?: JQueryEventObject): void; + (methodName: 'collapseAll', event?: JQueryEventObject, all?: boolean): void; + (methodName: 'destroy'): void; + (methodName: 'disable'): void; + (methodName: 'enable'): void; + (methodName: string, event: JQueryEventObject, item: JQuery): void; + (methodName: 'focus', event: JQueryEventObject, item: JQuery): void; + (methodName: 'isFirstItem'): boolean; + (methodName: 'isLastItem'): boolean; + (methodName: 'next', event?: JQueryEventObject): void; + (methodName: 'nextPage', event?: JQueryEventObject): void; + (methodName: 'previous', event?: JQueryEventObject): void; + (methodName: 'previousPage', event?: JQueryEventObject): void; + (methodName: 'refresh'): void; + (methodName: 'select', event?: JQueryEventObject): void; + (methodName: 'widget'): JQuery; + (methodName: string): JQuery; + (options: JQueryUI.MenuOptions): JQuery; + (optionLiteral: string, optionName: string): any; + (optionLiteral: string, options: JQueryUI.MenuOptions): any; + (optionLiteral: string, optionName: string, optionValue: any): JQuery; + active: boolean; + } progressbar(): JQuery; progressbar(methodName: 'destroy'): void; @@ -1659,6 +1688,7 @@ interface JQuery { sortable(methodName: string): JQuery; sortable(options: JQueryUI.SortableOptions): JQuery; sortable(optionLiteral: string, optionName: string): any; + sortable(methodName: 'serialize', options: { key?: string; attribute?: string; expression?: RegExp }): string; sortable(optionLiteral: string, options: JQueryUI.SortableOptions): any; sortable(optionLiteral: string, optionName: string, optionValue: any): JQuery; diff --git a/js-beautify/js-beautify.d.ts b/js-beautify/js-beautify.d.ts index e52614ad8..fc581ea90 100644 --- a/js-beautify/js-beautify.d.ts +++ b/js-beautify/js-beautify.d.ts @@ -9,7 +9,7 @@ declare var js_beautify: { indent_char?: string; eol?: string; indent_level?: number; - indent_width_tabs?: boolean; + indent_with_tabs?: boolean; preserve_newlines?: boolean; max_preserve_newlines?: number; jslint_happy: boolean; diff --git a/leaflet-label/leaflet-label.d.ts b/leaflet-label/leaflet-label.d.ts index 38bb43d7a..a77def73c 100644 --- a/leaflet-label/leaflet-label.d.ts +++ b/leaflet-label/leaflet-label.d.ts @@ -6,9 +6,13 @@ /// declare module L { - export interface IconOptions { - labelAnchor?: Point; - } + export interface IconOptions { + labelAnchor?: Point; + } + + export interface PathOptions { + labelAnchor?: Point; + } export interface CircleMarkerOptions { labelAnchor?: Point; diff --git a/leaflet/leaflet-tests.ts b/leaflet/leaflet-tests.ts index 4c8fd4d73..6bec7e217 100755 --- a/leaflet/leaflet-tests.ts +++ b/leaflet/leaflet-tests.ts @@ -186,7 +186,7 @@ map.once('contextmenu', (e: L.LeafletMouseEvent) => { var marker = L.marker(L.latLng(42, 51), { icon: L.icon({ - iconURl: 'roger.png', + iconUrl: 'roger.png', iconRetinaUrl: 'roger-retina.png', iconSize: L.point(40, 40), iconAnchor: L.point(20, 0), @@ -264,7 +264,6 @@ popup.setLatLng(L.latLng(12, 54)).setContent('this is nice popup').openOn(map); popup.update(); var tileLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}', { - foo: 'bar', minZoom: 0, maxZoom: 18, maxNativeZoom: 17, diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 92aed79b7..56d702485 100755 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -264,6 +264,11 @@ declare module L { declare module L { export interface ClassExtendOptions { + /** + * Your class's constructor function, meaning that it gets called when you do 'new MyClass(...)'. + */ + initialize?: Function; + /** * options is a special property that unlike other objects that you pass * to extend will be merged with the parent one instead of overriding it @@ -286,6 +291,8 @@ declare module L { * constants. */ static?: any; + + [prop: string]: any; } export interface ClassStatic { @@ -3592,6 +3599,11 @@ declare module L { */ autoPan?: boolean; + /** + * Set it to true if you want to prevent users from panning the popup off of the screen while it is open. + */ + keepInView?: boolean; + /** * Controls the presense of a close button in the popup. * @@ -3645,6 +3657,11 @@ declare module L { * option). */ closeOnClick?: boolean; + + /** + * A custom class name to assign to the popup. + */ + className?: string; } } @@ -4064,6 +4081,11 @@ declare module L { * Default value: false. */ reuseTiles?: boolean; + + /** + * When this option is set, the TileLayer only loads tiles that are in the given geographical bounds. + */ + bounds?: LatLngBounds; } } @@ -4219,13 +4241,12 @@ declare module L { declare module L { export interface ZoomOptions { - /** - * The position of the control (one of the map corners). See control positions. - * - * Default value: 'topright'. + * If not specified, zoom animation will happen if the zoom origin is inside the current view. + * If true, the map will attempt animating zoom disregarding where zoom origin is. + * Setting false will make it always reset the view completely without animation. */ - position?: string; + animate?: boolean; } } diff --git a/log4js/log4js.d.ts b/log4js/log4js.d.ts index 28d821377..4888b9f51 100644 --- a/log4js/log4js.d.ts +++ b/log4js/log4js.d.ts @@ -63,8 +63,8 @@ declare module "log4js" { */ export function shutdown(cb: Function): void; - export function configure(config: IConfig, options?: any): void; export function configure(filename: string, options?: any): void; + export function configure(config: IConfig, options?: any): void; export function setGlobalLogLevel(level: string): void; export function setGlobalLogLevel(level: Level): void; @@ -126,14 +126,118 @@ declare module "log4js" { } export interface IConfig { - appenders: IAppenderConfig[]; + appenders: AppenderConfig[]; levels?: { [category: string]: string }; replaceConsole?: boolean; } - export interface IAppenderConfig { + + export interface AppenderConfigBase { type: string; - category?: string[]; - // etc... + category?: string; } + + export interface ConsoleAppenderConfig extends AppenderConfigBase {} + + export interface FileAppenderConfig extends AppenderConfigBase { + filename: string; + } + export interface DateFileAppenderConfig extends FileAppenderConfig { + /** + * The following strings are recognised in the pattern: + * - yyyy : the full year, use yy for just the last two digits + * - MM : the month + * - dd : the day of the month + * - hh : the hour of the day (24-hour clock) + * - mm : the minute of the hour + * - ss : seconds + * - SSS : milliseconds (although I'm not sure you'd want to roll your logs every millisecond) + * - O : timezone (capital letter o) + */ + pattern: string; + alwaysIncludePattern: boolean; + } + + export interface SmtpAppenderConfig extends AppenderConfigBase { + /** Comma separated list of email recipients */ + recipients: string; + + /** Sender of all emails (defaults to transport user) */ + sender: string; + + /** Subject of all email messages (defaults to first event's message)*/ + subject: string; + + /** + * The time in seconds between sending attempts (defaults to 0). + * All events are buffered and sent in one email during this time. + * If 0 then every event sends an email + */ + sendInterval: number; + + SMTP: { + host: string; + secure: boolean; + port: number; + auth: { + user: string; + pass: string; + } + } + } + + export interface HookIoAppenderConfig extends FileAppenderConfig { + maxLogSize: number; + backup: number; + pollInterval: number; + } + + export interface GelfAppenderConfig extends AppenderConfigBase { + host: string; + hostname: string; + port: string; + facility: string; + } + + export interface MultiprocessAppenderConfig extends AppenderConfigBase { + mode: string; + loggerPort: number; + loggerHost: string; + facility: string; + appender?: AppenderConfig; + } + + export interface LogglyAppenderConfig extends AppenderConfigBase { + /** Loggly customer token - https://www.loggly.com/docs/api-sending-data/ */ + token: string; + + /** Loggly customer subdomain (use 'abc' for abc.loggly.com) */ + subdomain: string; + + /** an array of strings to help segment your data & narrow down search results in Loggly */ + tags: string[]; + + /** Enable JSON logging by setting to 'true' */ + json: boolean; + } + + export interface ClusteredAppenderConfig extends AppenderConfigBase { + appenders?: AppenderConfig[]; + } + + type CoreAppenderConfig = ConsoleAppenderConfig + | FileAppenderConfig + | DateFileAppenderConfig + | SmtpAppenderConfig + | HookIoAppenderConfig + | GelfAppenderConfig + | MultiprocessAppenderConfig + | LogglyAppenderConfig + | ClusteredAppenderConfig + + interface CustomAppenderConfig extends AppenderConfigBase { + [prop: string]: any; + } + + type AppenderConfig = CoreAppenderConfig | CustomAppenderConfig; } diff --git a/mCustomScrollbar/mCustomScrollbar.d.ts b/mCustomScrollbar/mCustomScrollbar.d.ts index 7e0a529ef..f41aca00a 100644 --- a/mCustomScrollbar/mCustomScrollbar.d.ts +++ b/mCustomScrollbar/mCustomScrollbar.d.ts @@ -40,6 +40,10 @@ declare module MCustomScrollbar { */ autoHideScrollbar?: boolean; scrollButtons?: { + /** + * Enable or disable scroll buttons. + */ + enable?: boolean; /** * Scroll buttons scroll type, values: "continuous" (scroll continuously while pressing the button), "pixels" (scrolls by a fixed number of pixels on each click") */ @@ -47,11 +51,11 @@ declare module MCustomScrollbar { /** * Scroll buttons continuous scrolling speed, integer value or "auto" (script calculates and sets the speed according to content length) */ - scrollSpeed?: any; + scrollSpeed?: number | string; /** - * Scroll buttons pixels scrolling amount, value in pixels + * Scroll buttons pixels scrolling amount, value in pixels or "auto" */ - scrollAmount?: number; + scrollAmount?: number | string; } advanced?: { /** @@ -94,14 +98,24 @@ declare module MCustomScrollbar { */ onScroll?: () => void; /** - * User defined callback function, triggered when scroll end-limit is reached + * A function to call when scrolling is completed and content is scrolled all the way to the end (bottom/right) + */ + onTotalScroll?: () => void; + /** + * A function to call when scrolling is completed and content is scrolled back to the beginning (top/left) */ onTotalScrollBack?: () => void; /** - * Scroll end-limit offset, value in pixels + * Set an offset for which the onTotalScroll callback is triggered. + * Its value is in pixels. */ onTotalScrollOffset?: number; /** + * Set an offset for which the onTotalScrollBack callback is triggered. + * Its value is in pixels + */ + onTotalScrollBackOffset?: number; + /** * User defined callback function, triggered while scrolling */ whileScrolling?: () => void; @@ -129,12 +143,6 @@ declare module MCustomScrollbar { } interface JQuery { - /** - * Creates a new mCustomScrollbar with the specified or default options - * - * @param options Override default options - */ - mCustomScrollbar(options?: MCustomScrollbar.CustomScrollbarOptions): JQuery; /** * Calls specified methods on the scrollbar "update", "stop", "disable", "destroy" * @@ -149,4 +157,10 @@ interface JQuery { * @param options Override default options */ mCustomScrollbar(scrollTo: string, parameter: any, options?: MCustomScrollbar.ScrollToParameterOptions): JQuery; + /** + * Creates a new mCustomScrollbar with the specified or default options + * + * @param options Override default options + */ + mCustomScrollbar(options?: MCustomScrollbar.CustomScrollbarOptions): JQuery; } \ No newline at end of file diff --git a/mailcheck/mailcheck.d.ts b/mailcheck/mailcheck.d.ts index c6f28d0db..64b5f93c4 100644 --- a/mailcheck/mailcheck.d.ts +++ b/mailcheck/mailcheck.d.ts @@ -47,6 +47,7 @@ declare module MailcheckModule { export interface IOptions { domains?: string[]; + secondLevelDomains?: string[]; topLevelDomains?: string[]; distanceFunction?: IDistanceFunction; suggested?: ISuggested | IJQuerySuggested; diff --git a/marked/marked-tests.ts b/marked/marked-tests.ts index ca8b96920..44be0f0e8 100644 --- a/marked/marked-tests.ts +++ b/marked/marked-tests.ts @@ -8,7 +8,7 @@ var options: MarkedOptions = { breaks: false, pedantic: false, sanitize: true, - smartLsts: true, + smartLists: true, silent: false, highlight: function (code: string, lang: string) { return ''; diff --git a/meteor/meteor.d.ts b/meteor/meteor.d.ts index ed0c97b29..2028cc266 100644 --- a/meteor/meteor.d.ts +++ b/meteor/meteor.d.ts @@ -134,7 +134,7 @@ declare module Meteor { } declare module Mongo { - interface Selector extends Object {} + interface Selector {} interface Modifier {} interface SortSpecifier {} interface FieldSpecifier { diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index ce4be964f..e840d8e05 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -6,10 +6,10 @@ /// declare module "mongoose" { - function connect(uri: string, options?: ConnectionOption, callback?: (err: any) => void): Mongoose; + function connect(uri: string, options?: ConnectionOptions , callback?: (err: any) => void): Mongoose; function createConnection(): Connection; - function createConnection(uri: string, options?: ConnectionOption): Connection; - function createConnection(host: string, database_name: string, port?: number, options?: ConnectionOption): Connection; + function createConnection(uri: string, options?: ConnectionOptions): Connection; + function createConnection(host: string, database_name: string, port?: number, options?: ConnectionOptions): Connection; function disconnect(callback?: (err?: any) => void): Mongoose; function model(name: string, schema?: Schema, collection?: string, skipInit?: boolean): Model; @@ -25,10 +25,10 @@ declare module "mongoose" { var connection: Connection; export class Mongoose { - connect(uri: string, options?: ConnectionOption, callback?: (err: any) => void): Mongoose; + connect(uri: string, options?: ConnectOpenOptionsBase, callback?: (err: any) => void): Mongoose; createConnection(): Connection; createConnection(uri: string, options?: Object): Connection; - createConnection(host: string, database_name: string, port?: number, options?: ConnectionOption): Connection; + createConnection(host: string, database_name: string, port?: number, options?: ConnectOpenOptionsBase): Connection; disconnect(callback?: (err?: any) => void): Mongoose; get(key: string): any; model(name: string, schema?: Schema, collection?: string, skipInit?: boolean): Model; @@ -49,23 +49,66 @@ declare module "mongoose" { collection(name: string, options?: Object): Collection; model(name: string, schema?: Schema, collection?: string): Model; modelNames(): string[]; - open(host: string, database?: string, port?: number, options?: ConnectionOption, callback?: (err: any) => void): Connection; - openSet(uris: string, database?: string, options?: ConnectionSetOption, callback?: (err: any) => void): Connection; + open(host: string, database?: string, port?: number, options?: OpenSetConnectionOptions, callback?: (err: any) => void): Connection; + openSet(uris: string, database?: string, options?: OpenSetConnectionOptions, callback?: (err: any) => void): Connection; db: any; collections: {[index: string]: Collection}; readyState: number; } - export interface ConnectionOption { + + export interface ConnectOpenOptionsBase { db?: any; server?: any; replset?: any; + /** Username for authentication if not supplied in the URI. */ user?: string; + /** Password for authentication if not supplied in the URI. */ pass?: string; + /** Options for authentication */ auth?: any; } - export interface ConnectionSetOption extends ConnectionOption { - mongos?: boolean; + + export interface ConnectionOptions extends ConnectOpenOptionsBase { + /** Passed to the underlying driver's Mongos instance. */ + mongos?: MongosOptions; + } + + interface OpenSetConnectionOptions extends ConnectOpenOptionsBase { + /** If true, enables High Availability support for mongos */ + mongos?: boolean; + } + + interface MongosOptions { + /** Turn on high availability monitoring. (default: true) */ + ha?: boolean; + /** Time between each replicaset status check. (default: 5000) */ + haInterval?: number; + /** + * Number of connections in the connection pool for each + * server instance. (default: 5 (for legacy reasons)) */ + poolSize?: number; + /** + * Use ssl connection (needs to have a mongod server with + * ssl support). (default: false). + */ + ssl?: boolean; + /** + * Validate mongod server certificate against ca + * (needs to have a mongod server with ssl support, 2.4 or higher) + * (default: true) + */ + sslValidate?: boolean; + /** Turn on high availability monitoring. */ + sslCA?: (Buffer|string)[]; + sslKey?: Buffer|string; + sslPass?: Buffer|string; + socketOptions?: { + noDelay?: boolean; + keepAlive?: number; + connectionTimeoutMS?: number; + socketTimeoutMS?: number; + }; } export interface Collection { diff --git a/needle/needle-tests.ts b/needle/needle-tests.ts index 24d9701b5..106d46a71 100644 --- a/needle/needle-tests.ts +++ b/needle/needle-tests.ts @@ -22,7 +22,7 @@ function ResponsePipeline() { var options = { compressed: true, - follow: true, + follow: 5, rejectUnauthorized: true }; diff --git a/needle/needle.d.ts b/needle/needle.d.ts index 741cf5fe3..e7a67387d 100644 --- a/needle/needle.d.ts +++ b/needle/needle.d.ts @@ -15,13 +15,21 @@ declare module Needle { interface RequestOptions { timeout?: number; - follow?: any; // number | string + follow?: number; + follow_max?: number; multipart?: boolean; proxy?: string; agent?: string; - headers?: any; + headers?: HttpHeaderOptions; auth?: string; // auto | digest | basic (default) json?: boolean; + + // These properties are overwritten by those in the 'headers' field + compressed?: boolean; + cookies?: { [name: string]: any; }; + // Overwritten if present in the URI + username?: string; + password?: string; } interface ResponseOptions { @@ -31,12 +39,15 @@ declare module Needle { } interface HttpHeaderOptions { + cookies?: { [name: string]: any; }; compressed?: boolean; - username?: string; - password?: string; accept?: string; connection?: string; user_agent?: string; + + // Overwritten if present in the URI + username?: string; + password?: string; } interface TLSOptions { diff --git a/node-gcm/node-gcm.d.ts b/node-gcm/node-gcm.d.ts index 3272acac4..cac54f31a 100644 --- a/node-gcm/node-gcm.d.ts +++ b/node-gcm/node-gcm.d.ts @@ -10,6 +10,9 @@ declare module "node-gcm" { delayWhileIdle?: boolean; timeToLive?: number; dryRun?: boolean; + data: { + [key: string]: string; + }; } export class Message { @@ -20,7 +23,7 @@ declare module "node-gcm" { dryRun: boolean; addData(key: string, value: string): void; - addData(data: any): void; + addData(data: { [key: string]: string }): void; } diff --git a/stripe/stripe-node.d.ts b/stripe/stripe-node.d.ts index cb5932086..d41fdc13e 100644 --- a/stripe/stripe-node.d.ts +++ b/stripe/stripe-node.d.ts @@ -2802,7 +2802,7 @@ declare module StripeNode { * A set of key/value pairs that you can attach to a reversal. It can be useful for storing * additional information about the reversal in a structured format. */ - interface IMetadata extends Object { } + interface IMetadata { } interface IShippingInformation { /** diff --git a/tedious/tedious-tests.ts b/tedious/tedious-tests.ts index 32c243614..f7346a174 100644 --- a/tedious/tedious-tests.ts +++ b/tedious/tedious-tests.ts @@ -11,7 +11,7 @@ var config: tedious.ConnectionConfig = { server: "127.0.0.1", options: { database: "somedb", - instance: "someinstance" + instanceName: "someinstance", } } diff --git a/vega/vega-tests.ts b/vega/vega-tests.ts index 2cbf9d7b9..bdb4973b3 100644 --- a/vega/vega-tests.ts +++ b/vega/vega-tests.ts @@ -1287,7 +1287,7 @@ var specs: Vega.Spec[] = [ "name": "x", "type": "linear", "range": "width", - "reverse": {"field": "index"}, + "reverse": true, "nice": true, "domain": {"data": "pop2000", "field": "data.people"} } diff --git a/vega/vega.d.ts b/vega/vega.d.ts index ebe89da02..3a959fe1c 100644 --- a/vega/vega.d.ts +++ b/vega/vega.d.ts @@ -369,6 +369,7 @@ declare module Vega { properties?: PropertySets; key?: string; delay?: ValueRef; + scales?: Scale[]; } export module Mark { diff --git a/vinyl-fs/vinyl-fs-tests.ts b/vinyl-fs/vinyl-fs-tests.ts index 9fbc45faf..a29746166 100644 --- a/vinyl-fs/vinyl-fs-tests.ts +++ b/vinyl-fs/vinyl-fs-tests.ts @@ -379,7 +379,7 @@ describe('dest stream', function () { cwd: __dirname, path: inputPath, contents: expectedContents, - stat: { + stat: { mode: expectedMode } }); @@ -420,7 +420,7 @@ describe('dest stream', function () { cwd: __dirname, path: inputPath, contents: contentStream, - stat: { + stat: { mode: expectedMode } }); @@ -463,7 +463,7 @@ describe('dest stream', function () { cwd: __dirname, path: inputPath, contents: null, - stat: { + stat: { isDirectory: function () { return true; }, @@ -713,7 +713,7 @@ describe('symlink stream', function () { cwd: __dirname, path: inputPath, contents: expectedContents, - stat: { + stat: { mode: expectedMode } }); @@ -754,7 +754,7 @@ describe('symlink stream', function () { cwd: __dirname, path: inputPath, contents: contentStream, - stat: { + stat: { mode: expectedMode } }); @@ -797,7 +797,7 @@ describe('symlink stream', function () { cwd: __dirname, path: inputPath, contents: null, - stat: { + stat: { isDirectory: function () { return true; }, @@ -874,7 +874,7 @@ describe('symlink stream', function () { cwd: __dirname, path: inputPath, contents: expectedContents, - stat: { + stat: { mode: expectedMode } }); diff --git a/vinyl/vinyl-tests.ts b/vinyl/vinyl-tests.ts index eb203bdae..cb1ceaea6 100644 --- a/vinyl/vinyl-tests.ts +++ b/vinyl/vinyl-tests.ts @@ -73,7 +73,7 @@ describe('File', () => { it('should set stat to given value', done => { var val = {}; - var file = new File({stat: val}); + var file = new File({stat: val}); file.stat.should.equal(val); done(); }); @@ -150,8 +150,8 @@ describe('File', () => { }); describe('isDirectory()', () => { - var fakeStat = { - isDirectory: () => { + var fakeStat = { + isDirectory() { return true; } }; @@ -191,8 +191,20 @@ describe('File', () => { file2.cwd.should.equal(file.cwd); file2.base.should.equal(file.base); file2.path.should.equal(file.path); - file2.contents.should.not.equal(file.contents, 'buffer ref should be different'); - file2.contents.toString('utf8').should.equal(file.contents.toString('utf8')); + + let fileContents = file.contents; + let file2Contents = file2.contents; + + file2Contents.should.not.equal(fileContents, 'buffer ref should be different'); + + let fileUtf8Contents = fileContents instanceof Buffer ? + fileContents.toString('utf8') : + (fileContents).toString(); + let file2Utf8Contents = file2Contents instanceof Buffer ? + file2Contents.toString('utf8') : + (file2Contents).toString(); + + file2Utf8Contents.should.equal(fileUtf8Contents); done(); }); @@ -294,7 +306,10 @@ describe('File', () => { var ret = file.pipe(stream); ret.should.equal(stream, 'should return the stream'); - file.contents.write(testChunk); + let fileContents = file.contents; + if (fileContents instanceof Buffer) { + fileContents.write(testChunk.toString()); + } }); it('should do nothing with null', done => { @@ -360,7 +375,10 @@ describe('File', () => { var ret = file.pipe(stream, {end: false}); ret.should.equal(stream, 'should return the stream'); - file.contents.write(testChunk); + let fileContents = file.contents; + if (fileContents instanceof Buffer) { + fileContents.write(testChunk.toString()); + } }); it('should do nothing with null', done => { @@ -475,7 +493,7 @@ describe('File', () => { var val = "test"; var file = new File(); try { - file.contents = val; + file.contents = new Buffer(val); } catch (err) { should.exist(err); done(); diff --git a/vinyl/vinyl.d.ts b/vinyl/vinyl.d.ts index 81aa781f9..b41a8151b 100644 --- a/vinyl/vinyl.d.ts +++ b/vinyl/vinyl.d.ts @@ -27,9 +27,18 @@ declare module 'vinyl' { */ path?: string; /** - * Type: Buffer|Stream|null (Default: null) + * Path history. Has no effect if options.path is passed. */ - contents?: any; + history?: string[]; + /** + * The result of an fs.stat call. See fs.Stats for more information. + */ + stat?: fs.Stats; + /** + * File contents. + * Type: Buffer, Stream, or null + */ + contents?: Buffer | NodeJS.ReadWriteStream; }); /** @@ -48,7 +57,7 @@ declare module 'vinyl' { /** * Type: Buffer|Stream|null (Default: null) */ - public contents: any; + public contents: Buffer | NodeJS.ReadableStream; /** * Returns path.relative for the file base and file path. * Example: