From 1c1d000362c240f6a6f9318e6325de9fbfce052c Mon Sep 17 00:00:00 2001 From: Per Kastman Date: Sun, 4 Oct 2015 15:20:31 +0200 Subject: [PATCH 001/134] Added typings for jquery cropbox plugin --- jquery.cropbox/jquery.cropbox.d.ts | 115 +++++++++++++++++++++++++ jquery.cropbox/jquery.cropbox.tests.ts | 39 +++++++++ 2 files changed, 154 insertions(+) create mode 100644 jquery.cropbox/jquery.cropbox.d.ts create mode 100644 jquery.cropbox/jquery.cropbox.tests.ts diff --git a/jquery.cropbox/jquery.cropbox.d.ts b/jquery.cropbox/jquery.cropbox.d.ts new file mode 100644 index 000000000..70e09a46a --- /dev/null +++ b/jquery.cropbox/jquery.cropbox.d.ts @@ -0,0 +1,115 @@ +// Type definitions for jQuery cropbox +// Project: https://github.com/acornejo/jquery-cropbox +// Definitions by: Per Kastman +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module jQueryCropBox { + + enum ShowControls { + never, + always, + hover, + auto + } + + interface CropboxArea { + cropX: number; + cropY: number; + cropW: number; + cropH: number; + } + + interface CropboxOptions { + /** + * Width in pixels of the cropping window + */ + width?: number; + /** + * Height in pixels of the cropping window + */ + height?: number; + /** + * Number of incremental zoom steps. With the default of 10, you have to click the zoom-in button 9 times to reach 100%. + */ + zoom?: number; + /** + * Maximum zoom value. With the default of 1.0 users can't zoom beyond the maximum image resolution. + */ + maxZoom?: number; + /** + * If not null, this is the entire html block that should appear on hover over the image for instructions and/or buttons (could include the zoom in/out buttons for example). If null, the default html block is used which has the text "Click to drag" and the zoom in/out buttons. Use false to disable controls. + */ + controls?: any; + /** + * Set the initial cropping area + */ + result?: CropboxArea; + /** + * This flag is used to determine when to display the controls. Never, always and hover do exactly what you would expect (never show them, always show them, show them on hover). The auto flag is the same as the hover flag, except that on mobile devices it always shows the controls (since there is no hover event). + */ + showControls?: ShowControls + } + + interface CropboxDragOptions { + startX: number, + startY: number, + dx: number, + dy: number + } + + interface CropboxSetCropOptions { + cropX: number, + cropY: number, + cropW: number, + cropH: number + } + + interface Cropbox { + /** + * Increase image zoom level by one step + */ + zoomIn(): void; + /** + * Decrease image zoom level by one step + */ + zoomOut(): void; + /** + * Set zoom leevl to a value between 0 and 1. Need to call update to reflect the changes. + */ + zoom(percent: number): void; + /** + * Simulate image dragging, starting from (startX,startY) and moving a delta of (dx,dy). Need to call update to reflect the changes. + */ + drag(options: CropboxDragOptions): void; + /** + * Set crop window. + */ + setCrop(options: CropboxSetCropOptions): void; + /** + * Update the cropped result (must call after zoom and drag). + */ + update(): void; + /** + * Generate a URL for the cropped image on the client (requires HTML5 compliant browser). + */ + getDataURL(): string; + /** + * Generate a Blob with the cropped image (requires HTML5 compliant browser). + */ + getBlob(): any; + /** + * Remove the cropbox functionality from the image. + */ + remove(): void; + } + +} +interface JQuery { + cropbox(params?: jQueryCropBox.CropboxOptions): jQueryCropBox.Cropbox +} + +interface JQueryStatic { + cropbox(params?: jQueryCropBox.CropboxOptions): jQueryCropBox.Cropbox +} diff --git a/jquery.cropbox/jquery.cropbox.tests.ts b/jquery.cropbox/jquery.cropbox.tests.ts new file mode 100644 index 000000000..cb8f0be5a --- /dev/null +++ b/jquery.cropbox/jquery.cropbox.tests.ts @@ -0,0 +1,39 @@ +/// +/// + +var cropboxWithDefaultSettings = $("#element").cropbox(); + +var cropboxOptions: jQueryCropBox.CropboxOptions = { + height: 500, + zoom: 5, + width: 0.5, +}; + +var cropboxWithOptions = $("#element").cropbox(cropboxOptions); + +cropboxWithOptions.zoomIn(); +cropboxWithOptions.zoomOut(); +cropboxWithOptions.zoom(50); + +var cropDragOption: jQueryCropBox.CropboxDragOptions = { + startX: 10, + startY: 0, + dx: 100, + dy: 100 +}; + +cropboxWithOptions.drag(cropDragOption); + +var cropboxSetCropOption: jQueryCropBox.CropboxSetCropOptions = { + cropX: 10, + cropY: 10, + cropW: 50, + cropH: 50 +}; + +cropboxWithOptions.setCrop(cropboxSetCropOption); + +cropboxWithOptions.update(); +cropboxWithOptions.getDataURL(); +cropboxWithOptions.getBlob(); +cropboxWithOptions.remove(); From 10c7ec397f4617dfb0fc7274fa9a8c054ff362b2 Mon Sep 17 00:00:00 2001 From: Per Kastman Date: Sun, 4 Oct 2015 15:25:44 +0200 Subject: [PATCH 002/134] Cleanup --- jquery.cropbox/jquery.cropbox.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.cropbox/jquery.cropbox.d.ts b/jquery.cropbox/jquery.cropbox.d.ts index 70e09a46a..82b550bf3 100644 --- a/jquery.cropbox/jquery.cropbox.d.ts +++ b/jquery.cropbox/jquery.cropbox.d.ts @@ -104,8 +104,8 @@ declare module jQueryCropBox { */ remove(): void; } - } + interface JQuery { cropbox(params?: jQueryCropBox.CropboxOptions): jQueryCropBox.Cropbox } From b9a7194092297ca857f96d971e290612bc2618d7 Mon Sep 17 00:00:00 2001 From: Per Kastman Date: Tue, 6 Oct 2015 18:56:29 +0200 Subject: [PATCH 003/134] Renamed according to naming convention --- .../jquery.cropbox.d.ts => jquery-cropbox/jquery-cropbox.d.ts | 4 ++-- .../jquery-cropbox.tests.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename jquery.cropbox/jquery.cropbox.d.ts => jquery-cropbox/jquery-cropbox.d.ts (96%) rename jquery.cropbox/jquery.cropbox.tests.ts => jquery-cropbox/jquery-cropbox.tests.ts (94%) diff --git a/jquery.cropbox/jquery.cropbox.d.ts b/jquery-cropbox/jquery-cropbox.d.ts similarity index 96% rename from jquery.cropbox/jquery.cropbox.d.ts rename to jquery-cropbox/jquery-cropbox.d.ts index 82b550bf3..fba9846bb 100644 --- a/jquery.cropbox/jquery.cropbox.d.ts +++ b/jquery-cropbox/jquery-cropbox.d.ts @@ -107,9 +107,9 @@ declare module jQueryCropBox { } interface JQuery { - cropbox(params?: jQueryCropBox.CropboxOptions): jQueryCropBox.Cropbox + cropbox(params?: jQueryCropBox.CropboxOptions): JQuery } interface JQueryStatic { - cropbox(params?: jQueryCropBox.CropboxOptions): jQueryCropBox.Cropbox + cropbox(params?: jQueryCropBox.CropboxOptions): JQueryStatic } diff --git a/jquery.cropbox/jquery.cropbox.tests.ts b/jquery-cropbox/jquery-cropbox.tests.ts similarity index 94% rename from jquery.cropbox/jquery.cropbox.tests.ts rename to jquery-cropbox/jquery-cropbox.tests.ts index cb8f0be5a..e8db3847c 100644 --- a/jquery.cropbox/jquery.cropbox.tests.ts +++ b/jquery-cropbox/jquery-cropbox.tests.ts @@ -1,5 +1,5 @@ /// -/// +/// var cropboxWithDefaultSettings = $("#element").cropbox(); From 68d3c81d8d635bd03136a19fd2d40d3dc500c7b9 Mon Sep 17 00:00:00 2001 From: Per Kastman Date: Tue, 6 Oct 2015 19:16:44 +0200 Subject: [PATCH 004/134] Fixed incorrect return type --- jquery-cropbox/jquery-cropbox.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery-cropbox/jquery-cropbox.d.ts b/jquery-cropbox/jquery-cropbox.d.ts index fba9846bb..82b550bf3 100644 --- a/jquery-cropbox/jquery-cropbox.d.ts +++ b/jquery-cropbox/jquery-cropbox.d.ts @@ -107,9 +107,9 @@ declare module jQueryCropBox { } interface JQuery { - cropbox(params?: jQueryCropBox.CropboxOptions): JQuery + cropbox(params?: jQueryCropBox.CropboxOptions): jQueryCropBox.Cropbox } interface JQueryStatic { - cropbox(params?: jQueryCropBox.CropboxOptions): JQueryStatic + cropbox(params?: jQueryCropBox.CropboxOptions): jQueryCropBox.Cropbox } From 1e9273d62eb6e2c2de01116c6446f006b47916b7 Mon Sep 17 00:00:00 2001 From: Per Kastman Date: Tue, 6 Oct 2015 19:29:47 +0200 Subject: [PATCH 005/134] Updated according to naming convention --- .../{jquery-cropbox.tests.ts => jquery-cropbox-tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jquery-cropbox/{jquery-cropbox.tests.ts => jquery-cropbox-tests.ts} (100%) diff --git a/jquery-cropbox/jquery-cropbox.tests.ts b/jquery-cropbox/jquery-cropbox-tests.ts similarity index 100% rename from jquery-cropbox/jquery-cropbox.tests.ts rename to jquery-cropbox/jquery-cropbox-tests.ts From c7a2374b86f8cb79d293be28dd53346a8627705f Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Sun, 8 Nov 2015 12:08:32 +0100 Subject: [PATCH 006/134] added media queries utils conform to foundation spec --- foundation/foundation.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/foundation/foundation.d.ts b/foundation/foundation.d.ts index a51e47ae9..ce782fd92 100644 --- a/foundation/foundation.d.ts +++ b/foundation/foundation.d.ts @@ -304,6 +304,16 @@ declare module Foundation { add_custom_rule(rule : string, media : string) : void; image_loaded(images : JQuery, callback : (...args : any[]) => any) : void; random_str(length? : number) : string; + is_small_only(): boolean; + is_small_up(): boolean; + is_medium_only(): boolean; + is_medium_up(): boolean; + is_large_only(): boolean; + is_large_up(): boolean; + is_xlarge_only(): boolean; + is_xlarge_up(): boolean; + is_xxlarge_only(): boolean; + is_xxlarge_up(): boolean; }; } } From f297bc50a4310c58bde65a6de686ab840dbee3e3 Mon Sep 17 00:00:00 2001 From: dreamair Date: Fri, 13 Nov 2015 22:17:05 +0100 Subject: [PATCH 007/134] Update some options for gulp-typescript 2.9.2. --- gulp-typescript/gulp-typescript.d.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/gulp-typescript/gulp-typescript.d.ts b/gulp-typescript/gulp-typescript.d.ts index 7b16d0a5a..f85245a30 100644 --- a/gulp-typescript/gulp-typescript.d.ts +++ b/gulp-typescript/gulp-typescript.d.ts @@ -20,10 +20,21 @@ declare module "gulp-typescript" { noImplicitAny?: boolean; noLib?: boolean; removeComments?: boolean; - sourceRoot?: string; + sourceRoot?: string; // use gulp-sourcemaps instead sortOutput?: boolean; target?: string; typescript?: any; + outFile?: string; + outDir?: string; + suppressImplicitAnyIndexErrors?: boolean; + jsx?: string; + declaration?: boolean; + emitDecoratorMetadata?: boolean; + experimentalAsyncFunctions?: boolean; + moduleResolution?: string; + noEmitHelpers?: boolean; + preserveConstEnums?: boolean; + isolatedModules?: boolean; } interface Project { @@ -51,4 +62,4 @@ declare module "gulp-typescript" { } export = GulpTypescript; -} \ No newline at end of file +} From 790dca65ae53d6ee95cdfcefb2666f169a588e7c Mon Sep 17 00:00:00 2001 From: Sabeeh Ul Hussnain Date: Sun, 22 Nov 2015 22:18:02 +0500 Subject: [PATCH 008/134] added definations for lobibox --- lobibox/lobibox.d.ts | 197 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 lobibox/lobibox.d.ts diff --git a/lobibox/lobibox.d.ts b/lobibox/lobibox.d.ts new file mode 100644 index 000000000..3ae7ebaef --- /dev/null +++ b/lobibox/lobibox.d.ts @@ -0,0 +1,197 @@ +// Type definitions for lobibox 1.0.1 +// Project: https://github.com/arboshiki/lobibox +// Definitions by: Sabeeh Ul Hussnain +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare var Lobibox: LobiboxModule.LobiboxStatic; +declare module "Lobibox" { + export = Lobibox; +} +declare module LobiboxModule { + interface MessageBoxesDefault { + title? : string; + horizontalOffset?: number; + width? : number; + height? : string; // Height is automatically given calculated by width + closeButton? : boolean; // Show close button or not + draggable? : boolean; // Make messagebox draggable + customBtnClass? : string; // Class for custom buttons + modal? : boolean; + debug? : boolean; + buttonsAlign? : string; // Position where buttons should be aligned + closeOnEsc? : boolean; // Close messagebox on Esc press + delayToRemove? : number; + baseClass? : string; + showClass? : string; + hideClass? : string; + msg? : string; + + // methods + hide? (): MessageBoxesDefault; + show? (): MessageBoxesDefault; + setWidth? (width?: number): MessageBoxesDefault; + setHeight? (height?: number): MessageBoxesDefault; + setSize? (width?: number, height?: number): MessageBoxesDefault; + setPosition? (left?: number|string, top?: number): MessageBoxesDefault; + setTitle? (title?: string): MessageBoxesDefault; + getTitle? (): string; + + // events + // when messagebox show is called but before it is actually shown + onShow? (lobibox:LobiboxStatic): void ; + // after messagebox is shown + shown? (lobibox:LobiboxStatic): void; + // when messagebox remove method is called but before it is actually hidden + beforeClose? (lobibox:LobiboxStatic): void; + // after messagebox is hidden + closed? (lobibox:LobiboxStatic): void; + } + + interface MessageBoxesOptions extends MessageBoxesDefault { + bodyClass? : string; + modalClasses? : { + 'error'? : string, + 'success'? : string, + 'info'? : string, + 'warning'? : string, + 'confirm'? : string, + 'progress'? : string, + 'prompt'? : string, + 'default'? : string, + 'window'? : string + }, + buttonsAlign?: any; + buttons?: { + ok?: { + 'class'?: string, + text?: string, + closeOnClick?: boolean + }, + cancel?: { + 'class'?: string, + text?: string, + closeOnClick?: boolean + }, + yes?: { + 'class'?: string, + text?: string, + closeOnClick?: boolean + }, + no?: { + 'class'?: string, + text?: string, + closeOnClick?: boolean + } + }; + callback? (lobibox:any, type:string); + } + interface ConfirmOptions extends MessageBoxesOptions { + title? : string; + width? : number; + iconClass? : string; + } + + interface PromptOptions extends MessageBoxesOptions, PromptMethods { + width?: number; + attrs?: any; // Object of any valid attribute of input field + value?: string; // Value which is given to textfield when messagebox is created + multiline?: boolean; // Set this true for multiline prompt + lines?: number; // This works only for multiline prompt. Number of lines + type?: string; // Prompt type. Available types (text|number|color) + label?: string; // Set some text which will be shown exactly on top of textfield + } + interface AlertOptions extends MessageBoxesOptions { + warning?: { + title?: string, + iconClass?: string // Change warning alert icon globally + }; + info?:{ + title?: string, + iconClass?: string // Change info alert icon globally + }; + success?: { + title?: string, + iconClass?: string // Change success alert icon globally + }; + error?: { + title?: string, + iconClass?: string // Change error alert icon globally + }; + } + interface ProgressOptions extends MessageBoxesOptions, ProgressMethods, ProgressEvents { + width? : number; + showProgressLabel? : boolean; // Show percentage of progress + label? : string; // Show progress label + progressTpl? : boolean; //Template of progress bar + + //Events + progressUpdated? : any; + progressCompleted? : any; + } + interface WindowOptions extends MessageBoxesOptions { + width? : number; + height? : any; + content? : string; // HTML Content of window + url? : string; // URL which will be used to load content + draggable? : boolean; // Override default option + autoload? : boolean; // Auto load from given url when window is created + loadMethod? : string; // Ajax method to load content + showAfterLoad? : boolean; // Show window after content is loaded or show and then load content + params? : {}; // Parameters which will be send by ajax for loading content + } + interface ProgressEvents { + progressUpdated? (lobibox:LobiboxStatic): void; + progressComplete? (lobibox:LobiboxStatic): void; + } + interface PromptMethods { + setValue? (val?:string): PromptMethods; + getValue? (): string; + } + interface ProgressMethods { + setProgress? (progress:number): ProgressMethods; + getProgress? (): number; + } + + interface NotifyDefault { + title?: boolean; // Title of notification. If you do not include the title in options it will automatically takes its value + //from Lobibox.notify.OPTIONS object depending of the type of the notifications or set custom string. Set this false to disable title + size?: string; // normal, mini, large + soundPath?: string; // The folder path where sounds are located + soundExt?: string; // Default extension for all sounds + showClass?: string; // Show animation class. + hideClass?: string; // Hide animation class. + icon?: boolean; // Icon of notification. Leave as is for default icon or set custom string + msg?: string; // Message of notification + img?: string; // Image source string + closable?: boolean; // Make notifications closable + delay?: number; // Hide notification after this time (in miliseconds) + delayIndicator?: boolean; // Show timer indicator + closeOnClick?: boolean; // Close notifications by clicking on them + width?: number; // Width of notification box + sound?: boolean; // Sound of notification. Set this false to disable sound. Leave as is for default sound or set custom soud path + position?: string; // Place to show notification. Available options: "top left", "top right", "bottom left", "bottom right" + } + interface NotifyOptions extends NotifyDefault, NotifyMethods { + 'class'?: string; //You can override options for large notifications from here + large?: {width?: number}; //You can override options for small notifications from here + mini?: {'class'?: string}; //Default options of different style notifications + success?: {'class'?: string, 'title'?: string,'icon'?: string,sound?: string}; + error?: {'class'?: string, 'title'?: string,'icon'?: string,sound?: string}; + warning?: {'class'?: string, 'title'?: string,'icon'?: string,sound?: string}; + info?: {'class'?: string, 'title'?: string,'icon'?: string,sound?: string}; + } + + interface NotifyMethods { + remove? (); + } + + interface LobiboxStatic { + base: {OPTIONS: MessageBoxesOptions, DEFAULTS: MessageBoxesDefault}; + alert: {(type: string, options?: AlertOptions), DEFAULTS: AlertOptions}; + prompt: {(type: string, options?: PromptOptions), DEFAULTS: PromptOptions}; + confirm: {(options?: ConfirmOptions), DEFAULTS: ConfirmOptions}; + progress: {(options: ProgressOptions), DEFAULTS: ProgressOptions}; + window: {(options: WindowOptions), DEFAULTS: WindowOptions}; + notify: {(type: string, options?: NotifyOptions), DEFAULTS?: NotifyDefault,OPTIONS?:NotifyOptions}; + } +} From f7c659b988a242220f3e82105957fa053c264b76 Mon Sep 17 00:00:00 2001 From: Sabeeh Ul Hussnain Date: Sun, 22 Nov 2015 22:52:27 +0500 Subject: [PATCH 009/134] lobibox test code --- lobibox/lobibox.js-test.ts | 134 +++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 lobibox/lobibox.js-test.ts diff --git a/lobibox/lobibox.js-test.ts b/lobibox/lobibox.js-test.ts new file mode 100644 index 000000000..4a14edf47 --- /dev/null +++ b/lobibox/lobibox.js-test.ts @@ -0,0 +1,134 @@ +/** + * Created by itboy on 11/22/2015. + */ + /// + /// + + //extending default parameters +Lobibox.notify.DEFAULTS = $.extend({}, Lobibox.notify.DEFAULTS, { + //override any options from default options + delay: false, + soundPath: '/libraries/lobibox/sounds/', + size: 'mini' +}); + +// notify +Lobibox.notify("error", {msg: "Hello world"}); +Lobibox.notify("success", {msg: "Hello world"}); +Lobibox.notify("warning", {msg: "Hello world"}); +Lobibox.notify("info", {msg: "Hello world"}); + +// alert +Lobibox.alert("error", {msg: "Hello world"}); +Lobibox.alert("success", {msg: "Hello world"}); +Lobibox.alert("warning", {msg: "Hello world"}); +Lobibox.alert("info", {msg: "Hello world"}); + +//alert with more options +Lobibox.alert('error', { + msg: 'This is an error message', + //buttons: ['ok', 'cancel', 'yes', 'no'], + //Or more powerfull way + buttons: { + ok: { + 'class': 'btn btn-info', + closeOnClick: false + }, + cancel: { + 'class': 'btn btn-danger', + closeOnClick: false + }, + yes: { + 'class': 'btn btn-success', + closeOnClick: false + }, + no: { + 'class': 'btn btn-warning', + closeOnClick: false + }, + custom: { + 'class': 'btn btn-default', + text: 'Custom' + } + }, + callback: function (lobibox, type) { + var btnType; + if (type === 'no') { + btnType = 'warning'; + } else if (type === 'yes') { + btnType = 'success'; + } else if (type === 'ok') { + btnType = 'info'; + } else if (type === 'cancel') { + btnType = 'error'; + } + Lobibox.notify(btnType, { + size: 'mini', + msg: 'This is ' + btnType + ' message' + }); + } +}); + +// confirm +Lobibox.confirm({ + msg: "Are you ok", +}); + +// prompt +Lobibox.prompt("text", { + title: 'Please enter username', + //Attributes of + attrs: { + placeholder: "Username" + } +}); + +// progress +Lobibox.progress({ + title: 'Please wait', + label: 'Uploading files...', + onShow: function ($this) { + var i = 0; + var inter = setInterval(function () { + window.console.log(i); + if (i > 100) { + clearInterval(inter); + } + i = i + 0.1; + $this.setProgress(i); + }, 10); + } +}); + +// window +Lobibox.window({ + title: 'Window title', + //Available types: string, jquery object, function + content: function () { + return $('.container'); + }, + url: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.css', + autoload: false, + loadMethod: 'GET', + //Load parameters + params: { + param1: 'Lorem', + param2: 'Ipsum' + }, + buttons: { + load: { + text: 'Load from url' + }, + close: { + text: 'Close', + closeOnClick: true + } + }, + callback: function ($this, type, ev) { + if (type === 'load') { + $this.load(function () { + //Do something when content is loaded + }); + } + } +}); From 53fba494cd604075a86f161829963ca08871f213 Mon Sep 17 00:00:00 2001 From: Sabeeh Ul Hussnain Date: Sun, 22 Nov 2015 22:54:34 +0500 Subject: [PATCH 010/134] added definations for lobibox --- lobibox/lobibox.d.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lobibox/lobibox.d.ts b/lobibox/lobibox.d.ts index 3ae7ebaef..a68be8368 100644 --- a/lobibox/lobibox.d.ts +++ b/lobibox/lobibox.d.ts @@ -38,13 +38,13 @@ declare module LobiboxModule { // events // when messagebox show is called but before it is actually shown - onShow? (lobibox:LobiboxStatic): void ; + onShow? (lobibox:any): void ; // after messagebox is shown - shown? (lobibox:LobiboxStatic): void; + shown? (lobibox:any): void; // when messagebox remove method is called but before it is actually hidden - beforeClose? (lobibox:LobiboxStatic): void; + beforeClose? (lobibox:any): void; // after messagebox is hidden - closed? (lobibox:LobiboxStatic): void; + closed? (lobibox:any): void; } interface MessageBoxesOptions extends MessageBoxesDefault { @@ -81,7 +81,8 @@ declare module LobiboxModule { 'class'?: string, text?: string, closeOnClick?: boolean - } + }, + custom?: any, }; callback? (lobibox:any, type:string); } From 924aba24b25b21f9c38f2b8c65a201eaf5584927 Mon Sep 17 00:00:00 2001 From: Sabeeh Ul Hussnain Date: Sun, 22 Nov 2015 23:38:23 +0500 Subject: [PATCH 011/134] definitions for lobibox errors fixed --- lobibox/lobibox.d.ts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/lobibox/lobibox.d.ts b/lobibox/lobibox.d.ts index a68be8368..2a951451f 100644 --- a/lobibox/lobibox.d.ts +++ b/lobibox/lobibox.d.ts @@ -82,9 +82,8 @@ declare module LobiboxModule { text?: string, closeOnClick?: boolean }, - custom?: any, - }; - callback? (lobibox:any, type:string); + }|any; + callback? (lobibox:any, type:string, ev: any): void; } interface ConfirmOptions extends MessageBoxesOptions { title? : string; @@ -132,7 +131,7 @@ declare module LobiboxModule { interface WindowOptions extends MessageBoxesOptions { width? : number; height? : any; - content? : string; // HTML Content of window + content? : any; // HTML Content of window url? : string; // URL which will be used to load content draggable? : boolean; // Override default option autoload? : boolean; // Auto load from given url when window is created @@ -183,16 +182,16 @@ declare module LobiboxModule { } interface NotifyMethods { - remove? (); + remove? (): any; } interface LobiboxStatic { base: {OPTIONS: MessageBoxesOptions, DEFAULTS: MessageBoxesDefault}; - alert: {(type: string, options?: AlertOptions), DEFAULTS: AlertOptions}; - prompt: {(type: string, options?: PromptOptions), DEFAULTS: PromptOptions}; - confirm: {(options?: ConfirmOptions), DEFAULTS: ConfirmOptions}; - progress: {(options: ProgressOptions), DEFAULTS: ProgressOptions}; - window: {(options: WindowOptions), DEFAULTS: WindowOptions}; - notify: {(type: string, options?: NotifyOptions), DEFAULTS?: NotifyDefault,OPTIONS?:NotifyOptions}; + alert: {(type: string, options?: T): LobiboxStatic, DEFAULTS: AlertOptions}; + prompt: {(type: string, options?: T): LobiboxStatic, DEFAULTS: PromptOptions}; + confirm: {(options?: ConfirmOptions): T, DEFAULTS: ConfirmOptions}; + progress: {(options: ProgressOptions): T, DEFAULTS: ProgressOptions}; + window: {(options: WindowOptions): T, DEFAULTS: WindowOptions}; + notify: {(type: string, options?: NotifyOptions): T, DEFAULTS?: NotifyDefault,OPTIONS?:NotifyOptions}; } } From 2440326118730fd8ec352217dc43cd6688955eb0 Mon Sep 17 00:00:00 2001 From: Sabeeh Ul Hussnain Date: Sun, 22 Nov 2015 23:39:01 +0500 Subject: [PATCH 012/134] lobibox test code updated --- lobibox/lobibox.js-test.ts | 224 +++++++++++++++++++------------------ 1 file changed, 114 insertions(+), 110 deletions(-) diff --git a/lobibox/lobibox.js-test.ts b/lobibox/lobibox.js-test.ts index 4a14edf47..6060ac175 100644 --- a/lobibox/lobibox.js-test.ts +++ b/lobibox/lobibox.js-test.ts @@ -5,130 +5,134 @@ /// //extending default parameters -Lobibox.notify.DEFAULTS = $.extend({}, Lobibox.notify.DEFAULTS, { - //override any options from default options - delay: false, - soundPath: '/libraries/lobibox/sounds/', - size: 'mini' -}); +class LobiboxTest { + static test() { + Lobibox.notify.DEFAULTS = $.extend({}, Lobibox.notify.DEFAULTS, { + //override any options from default options + delay: false, + soundPath: '/libraries/lobibox/sounds/', + size: 'mini' + }); // notify -Lobibox.notify("error", {msg: "Hello world"}); -Lobibox.notify("success", {msg: "Hello world"}); -Lobibox.notify("warning", {msg: "Hello world"}); -Lobibox.notify("info", {msg: "Hello world"}); + Lobibox.notify("error", {msg: "Hello world"}); + Lobibox.notify("success", {msg: "Hello world"}); + Lobibox.notify("warning", {msg: "Hello world"}); + Lobibox.notify("info", {msg: "Hello world"}); // alert -Lobibox.alert("error", {msg: "Hello world"}); -Lobibox.alert("success", {msg: "Hello world"}); -Lobibox.alert("warning", {msg: "Hello world"}); -Lobibox.alert("info", {msg: "Hello world"}); + Lobibox.alert("error", {msg: "Hello world"}); + Lobibox.alert("success", {msg: "Hello world"}); + Lobibox.alert("warning", {msg: "Hello world"}); + Lobibox.alert("info", {msg: "Hello world"}); //alert with more options -Lobibox.alert('error', { - msg: 'This is an error message', - //buttons: ['ok', 'cancel', 'yes', 'no'], - //Or more powerfull way - buttons: { - ok: { - 'class': 'btn btn-info', - closeOnClick: false - }, - cancel: { - 'class': 'btn btn-danger', - closeOnClick: false - }, - yes: { - 'class': 'btn btn-success', - closeOnClick: false - }, - no: { - 'class': 'btn btn-warning', - closeOnClick: false - }, - custom: { - 'class': 'btn btn-default', - text: 'Custom' - } - }, - callback: function (lobibox, type) { - var btnType; - if (type === 'no') { - btnType = 'warning'; - } else if (type === 'yes') { - btnType = 'success'; - } else if (type === 'ok') { - btnType = 'info'; - } else if (type === 'cancel') { - btnType = 'error'; - } - Lobibox.notify(btnType, { - size: 'mini', - msg: 'This is ' + btnType + ' message' + Lobibox.alert('error', { + msg: 'This is an error message', + //buttons: ['ok', 'cancel', 'yes', 'no'], + //Or more powerfull way + buttons: { + ok: { + 'class': 'btn btn-info', + closeOnClick: false + }, + cancel: { + 'class': 'btn btn-danger', + closeOnClick: false + }, + yes: { + 'class': 'btn btn-success', + closeOnClick: false + }, + no: { + 'class': 'btn btn-warning', + closeOnClick: false + }, + custom: { + 'class': 'btn btn-default', + text: 'Custom' + } + }, + callback: function (lobibox, type) { + var btnType; + if (type === 'no') { + btnType = 'warning'; + } else if (type === 'yes') { + btnType = 'success'; + } else if (type === 'ok') { + btnType = 'info'; + } else if (type === 'cancel') { + btnType = 'error'; + } + Lobibox.notify(btnType, { + size: 'mini', + msg: 'This is ' + btnType + ' message' + }); + } }); - } -}); // confirm -Lobibox.confirm({ - msg: "Are you ok", -}); + Lobibox.confirm({ + msg: "Are you ok", + }); // prompt -Lobibox.prompt("text", { - title: 'Please enter username', - //Attributes of - attrs: { - placeholder: "Username" - } -}); + Lobibox.prompt("text", { + title: 'Please enter username', + //Attributes of + attrs: { + placeholder: "Username" + } + }); // progress -Lobibox.progress({ - title: 'Please wait', - label: 'Uploading files...', - onShow: function ($this) { - var i = 0; - var inter = setInterval(function () { - window.console.log(i); - if (i > 100) { - clearInterval(inter); + Lobibox.progress({ + title: 'Please wait', + label: 'Uploading files...', + onShow: function ($this) { + var i = 0; + var inter = setInterval(function () { + window.console.log(i); + if (i > 100) { + clearInterval(inter); + } + i = i + 0.1; + $this.setProgress(i); + }, 10); } - i = i + 0.1; - $this.setProgress(i); - }, 10); - } -}); + }); // window -Lobibox.window({ - title: 'Window title', - //Available types: string, jquery object, function - content: function () { - return $('.container'); - }, - url: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.css', - autoload: false, - loadMethod: 'GET', - //Load parameters - params: { - param1: 'Lorem', - param2: 'Ipsum' - }, - buttons: { - load: { - text: 'Load from url' - }, - close: { - text: 'Close', - closeOnClick: true - } - }, - callback: function ($this, type, ev) { - if (type === 'load') { - $this.load(function () { - //Do something when content is loaded - }); - } + Lobibox.window({ + title: 'Window title', + //Available types: string, jquery object, function + content: function () { + return $('.container'); + }, + url: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.css', + autoload: false, + loadMethod: 'GET', + //Load parameters + params: { + param1: 'Lorem', + param2: 'Ipsum' + }, + buttons: { + load: { + text: 'Load from url' + }, + close: { + text: 'Close', + closeOnClick: true + } + }, + callback: function ($this, type, ev) { + if (type === 'load') { + $this.load(function () { + //Do something when content is loaded + }); + } + } + }); } -}); +} From 8b698cb8bb9f94b34168f613afe9cf171d69e65f Mon Sep 17 00:00:00 2001 From: Sabeeh Ul Hussnain Date: Sun, 22 Nov 2015 23:48:55 +0500 Subject: [PATCH 013/134] updated lobibox test code --- lobibox/lobibox.js-test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lobibox/lobibox.js-test.ts b/lobibox/lobibox.js-test.ts index 6060ac175..b4fea7a14 100644 --- a/lobibox/lobibox.js-test.ts +++ b/lobibox/lobibox.js-test.ts @@ -1,12 +1,14 @@ /** * Created by itboy on 11/22/2015. */ - /// + /// /// - //extending default parameters + // run test by calling + // LobiboxTest.test(); class LobiboxTest { static test() { + //extending default parameters Lobibox.notify.DEFAULTS = $.extend({}, Lobibox.notify.DEFAULTS, { //override any options from default options delay: false, From 52b9b36e5dd45a8d58b43b4e4b3d0be6b59d90ee Mon Sep 17 00:00:00 2001 From: Sabeeh Ul Hussnain Date: Sun, 22 Nov 2015 23:59:47 +0500 Subject: [PATCH 014/134] updated lobibox test code --- lobibox/lobibox.js-test.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lobibox/lobibox.js-test.ts b/lobibox/lobibox.js-test.ts index b4fea7a14..bd0ff33d2 100644 --- a/lobibox/lobibox.js-test.ts +++ b/lobibox/lobibox.js-test.ts @@ -4,11 +4,11 @@ /// /// - // run test by calling - // LobiboxTest.test(); + + //Run test : LobiboxTest.test() class LobiboxTest { static test() { - //extending default parameters + // extending default parameters Lobibox.notify.DEFAULTS = $.extend({}, Lobibox.notify.DEFAULTS, { //override any options from default options delay: false, @@ -55,8 +55,8 @@ class LobiboxTest { text: 'Custom' } }, - callback: function (lobibox, type) { - var btnType; + callback: function (lobibox:any, type:string):any { + let btnType:string = ""; if (type === 'no') { btnType = 'warning'; } else if (type === 'yes') { @@ -91,9 +91,9 @@ class LobiboxTest { Lobibox.progress({ title: 'Please wait', label: 'Uploading files...', - onShow: function ($this) { + onShow: function ($this:any):void { var i = 0; - var inter = setInterval(function () { + var inter = setInterval(function ():void { window.console.log(i); if (i > 100) { clearInterval(inter); @@ -108,7 +108,7 @@ class LobiboxTest { Lobibox.window({ title: 'Window title', //Available types: string, jquery object, function - content: function () { + content: function ():any { return $('.container'); }, url: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.css', @@ -128,9 +128,9 @@ class LobiboxTest { closeOnClick: true } }, - callback: function ($this, type, ev) { + callback: function ($this:any, type:string, ev:any):void { if (type === 'load') { - $this.load(function () { + $this.load(function ():any { //Do something when content is loaded }); } From e020d6b8a1a7c30d1678e2b75cd3ed15e95ae37b Mon Sep 17 00:00:00 2001 From: Sabeeh Ul Hussnain Date: Mon, 23 Nov 2015 00:00:11 +0500 Subject: [PATCH 015/134] definitions for lobibox errors fixed --- lobibox/lobibox.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lobibox/lobibox.d.ts b/lobibox/lobibox.d.ts index 2a951451f..d8a7588d5 100644 --- a/lobibox/lobibox.d.ts +++ b/lobibox/lobibox.d.ts @@ -83,7 +83,7 @@ declare module LobiboxModule { closeOnClick?: boolean }, }|any; - callback? (lobibox:any, type:string, ev: any): void; + callback? (lobibox:any, type?:string, ev?: any): void; } interface ConfirmOptions extends MessageBoxesOptions { title? : string; From 97d7377cf8f38d1c4e8e424f4a55de99428fe281 Mon Sep 17 00:00:00 2001 From: gcroteau Date: Mon, 23 Nov 2015 22:57:19 -0500 Subject: [PATCH 016/134] Initial commit. Created turf.d.ts and turf-test.ts files. --- turf/turf-test.ts | 0 turf/turf.d.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 turf/turf-test.ts create mode 100644 turf/turf.d.ts diff --git a/turf/turf-test.ts b/turf/turf-test.ts new file mode 100644 index 000000000..e69de29bb diff --git a/turf/turf.d.ts b/turf/turf.d.ts new file mode 100644 index 000000000..e69de29bb From 8ccfe0dd015abcdae1625bfc795ca7ae6615fd78 Mon Sep 17 00:00:00 2001 From: gcroteau Date: Tue, 24 Nov 2015 14:54:21 -0500 Subject: [PATCH 017/134] Added definition for distance and pointOnLine. Added related tests. --- turf/turf-test.ts | 94 +++++++++++++++++++++++++++++++++++++++++++++++ turf/turf.d.ts | 65 ++++++++++++++++++++++++++++++++ 2 files changed, 159 insertions(+) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index e69de29bb..1cf6be9b0 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -0,0 +1,94 @@ +/// + +////////////////////////////////////////////////////////////////////////// +// Tests Aggregation +////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////// +// Tests Measurement +////////////////////////////////////////////////////////////////////////// + +var point1 = { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-75.343, 39.984] + } +}; +var point2 = { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-75.534, 39.123] + } +}; +var units = "miles"; + +var points = { + "type": "FeatureCollection", + "features": [point1, point2] +}; + +var distance = turf.distance(point1, point2, units); + +////////////////////////////////////////////////////////////////////////// +// Tests Transformation +////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////// +// Tests Misc +////////////////////////////////////////////////////////////////////////// + +var line = { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [-77.031669, 38.878605], + [-77.029609, 38.881946], + [-77.020339, 38.884084], + [-77.025661, 38.885821], + [-77.021884, 38.889563], + [-77.019824, 38.892368] + ] + } +}; +var pt = { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-77.037076, 38.884017] + } +}; + +var snapped = turf.pointOnLine(line, pt); +snapped.properties['marker-color'] = '#00f' + +var result = { + "type": "FeatureCollection", + "features": [line, pt, snapped] +}; + +////////////////////////////////////////////////////////////////////////// +// Tests Helper +////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////// +// Tests Data +////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////// +// Tests Interpolation +//////////////////////////////////////////////////////////////////////////; + +////////////////////////////////////////////////////////////////////////// +// Tests Joins +////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////// +// Tests Classification +////////////////////////////////////////////////////////////////////////// diff --git a/turf/turf.d.ts b/turf/turf.d.ts index e69de29bb..cde4b59d3 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -0,0 +1,65 @@ +// Type definitions for Turf 2.0 +// Project: http://turfjs.org/ +// Definitions by: Guillaume Croteau +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module turf { + ////////////////////////////////////////////////////////////////////////// + // Aggregation + ////////////////////////////////////////////////////////////////////////// + + ////////////////////////////////////////////////////////////////////////// + // Measurement + ////////////////////////////////////////////////////////////////////////// + + /** + * Calculates the distance between two points in degress, radians, miles, or kilometers. This uses the Haversine formula to account for global curvature. + * @param from Origin point + * @param to Destination point + * @param units Can be degrees, radians, miles, or kilometers. Default is kilometers. + * @returns Distance between the two points + */ + function distance(from: GeoJSON.Feature, to: GeoJSON.Feature, units?: string): number; + + ////////////////////////////////////////////////////////////////////////// + // Transformation + ////////////////////////////////////////////////////////////////////////// + + ////////////////////////////////////////////////////////////////////////// + // Misc + ////////////////////////////////////////////////////////////////////////// + + /** + * Takes a Point and a LineString and calculates the closest Point on the LineString. + * @param line Line to snap to + * @param point Point to snap from + * @returns Closest point on the line to point + */ + function pointOnLine(line: GeoJSON.Feature, point: GeoJSON.Feature): GeoJSON.Feature; + + ////////////////////////////////////////////////////////////////////////// + // Helper + ////////////////////////////////////////////////////////////////////////// + + ////////////////////////////////////////////////////////////////////////// + // Data + ////////////////////////////////////////////////////////////////////////// + + ////////////////////////////////////////////////////////////////////////// + // Interpolation + //////////////////////////////////////////////////////////////////////////; + + ////////////////////////////////////////////////////////////////////////// + // Joins + ////////////////////////////////////////////////////////////////////////// + + ////////////////////////////////////////////////////////////////////////// + // Classification + ////////////////////////////////////////////////////////////////////////// + + ////////////////////////////////////////////////////////////////////////// + // Types + ////////////////////////////////////////////////////////////////////////// +} From 9488d2229fd7f91287777bcd3d61f658b3a1c020 Mon Sep 17 00:00:00 2001 From: gcroteau Date: Tue, 24 Nov 2015 16:53:35 -0500 Subject: [PATCH 018/134] Added along and area definition. Added related tests. --- turf/turf-test.ts | 100 ++++++++++++++++++++++++++++++++-------------- turf/turf.d.ts | 18 ++++++++- 2 files changed, 86 insertions(+), 32 deletions(-) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index 1cf6be9b0..5d1a73a93 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -1,11 +1,7 @@ /// ////////////////////////////////////////////////////////////////////////// -// Tests Aggregation -////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////// -// Tests Measurement +// Tests data initialisation ////////////////////////////////////////////////////////////////////////// var point1 = { @@ -16,6 +12,7 @@ var point1 = { "coordinates": [-75.343, 39.984] } }; + var point2 = { "type": "Feature", "properties": {}, @@ -24,22 +21,6 @@ var point2 = { "coordinates": [-75.534, 39.123] } }; -var units = "miles"; - -var points = { - "type": "FeatureCollection", - "features": [point1, point2] -}; - -var distance = turf.distance(point1, point2, units); - -////////////////////////////////////////////////////////////////////////// -// Tests Transformation -////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////// -// Tests Misc -////////////////////////////////////////////////////////////////////////// var line = { "type": "Feature", @@ -56,21 +37,78 @@ var line = { ] } }; -var pt = { - "type": "Feature", - "properties": {}, - "geometry": { - "type": "Point", - "coordinates": [-77.037076, 38.884017] - } + +var polygons = { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [[ + [-67.031021, 10.458102], + [-67.031021, 10.53372], + [-66.929397, 10.53372], + [-66.929397, 10.458102], + [-67.031021, 10.458102] + ]] + } + }, { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [[ + [-66.919784, 10.397325], + [-66.919784, 10.513467], + [-66.805114, 10.513467], + [-66.805114, 10.397325], + [-66.919784, 10.397325] + ]] + } + } + ] }; -var snapped = turf.pointOnLine(line, pt); -snapped.properties['marker-color'] = '#00f' +////////////////////////////////////////////////////////////////////////// +// Tests Aggregation +////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////// +// Tests Measurement +////////////////////////////////////////////////////////////////////////// + +// -- Test along -- +var along = turf.along(line, 1, 'miles'); var result = { "type": "FeatureCollection", - "features": [line, pt, snapped] + "features": [line, along] +}; + +// -- Test area -- +var area = turf.area(polygons); + +// -- Test distance -- +var units = "miles"; +var distance = turf.distance(point1, point2, units); + +////////////////////////////////////////////////////////////////////////// +// Tests Transformation +////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////// +// Tests Misc +////////////////////////////////////////////////////////////////////////// + +// -- Test pointOnLine -- +var snapped = turf.pointOnLine(line, point1); +snapped.properties['marker-color'] = '#00f' + +result = { + "type": "FeatureCollection", + "features": [line, point1, snapped] }; ////////////////////////////////////////////////////////////////////////// diff --git a/turf/turf.d.ts b/turf/turf.d.ts index cde4b59d3..15e9478db 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -14,11 +14,27 @@ declare module turf { // Measurement ////////////////////////////////////////////////////////////////////////// + /** + * Takes a line and returns a point at a specified distance along the line. + * @param line Input line + * @param distance Distance along the line + * @param [units=miles] Can be degrees, radians, miles, or kilometers. Default is miles + * @returns Point along the line + */ + function along(line: GeoJSON.Feature, distance: number, units?: string): GeoJSON.Feature; + + /** + * Takes one or more features and returns their area in square meters. + * @param input Input features + * @returns Area in square meters + */ + function area(input: GeoJSON.Feature | GeoJSON.FeatureCollection): number; + /** * Calculates the distance between two points in degress, radians, miles, or kilometers. This uses the Haversine formula to account for global curvature. * @param from Origin point * @param to Destination point - * @param units Can be degrees, radians, miles, or kilometers. Default is kilometers. + * @param [units=kilometers] Can be degrees, radians, miles, or kilometers. Default is kilometers. * @returns Distance between the two points */ function distance(from: GeoJSON.Feature, to: GeoJSON.Feature, units?: string): number; From 848b9d84676b802a37e6d0d9dca226780c9f311c Mon Sep 17 00:00:00 2001 From: gcroteau Date: Tue, 24 Nov 2015 19:52:59 -0500 Subject: [PATCH 019/134] Completed the Measurement definitions. --- turf/turf-test.ts | 157 ++++++++++++++++++++++++++++++++++++++++++---- turf/turf.d.ts | 135 ++++++++++++++++++++++++++++++++------- 2 files changed, 259 insertions(+), 33 deletions(-) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index 5d1a73a93..c248ebda1 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -71,6 +71,112 @@ var polygons = { ] }; +var polygon = { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [[ + [105.818939,21.004714], + [105.818939,21.061754], + [105.890007,21.061754], + [105.890007,21.004714], + [105.818939,21.004714] + ]] + } +}; + +var features = { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-97.522259, 35.4691] + } + }, { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-97.502754, 35.463455] + } + }, { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-97.508269, 35.463245] + } + }, { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-97.516809, 35.465779] + } + }, { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-97.515372, 35.467072] + } + }, { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-97.509363, 35.463053] + } + }, { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-97.511123, 35.466601] + } + }, { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-97.518547, 35.469327] + } + }, { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-97.519706, 35.469659] + } + }, { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-97.517839, 35.466998] + } + }, { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-97.508678, 35.464942] + } + }, { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [-97.514914, 35.463453] + } + } + ] +}; + ////////////////////////////////////////////////////////////////////////// // Tests Aggregation ////////////////////////////////////////////////////////////////////////// @@ -82,18 +188,53 @@ var polygons = { // -- Test along -- var along = turf.along(line, 1, 'miles'); -var result = { - "type": "FeatureCollection", - "features": [line, along] -}; - // -- Test area -- var area = turf.area(polygons); +// -- Test bboxPolygon -- +var bbox = [0, 0, 10, 10]; +var poly = turf.bboxPolygon(bbox); + +// -- Test bearing -- +var bearing = turf.bearing(point1, point2); + +// -- Test center +var centerPt = turf.center(features); + +// -- Test centroid -- +var centroidPt = turf.centroid(poly); + +// -- Test destination -- +var distance = 50; +var bearing = 90; +var units = 'miles'; +var destination = turf.destination(point1, distance, bearing, units); + // -- Test distance -- var units = "miles"; var distance = turf.distance(point1, point2, units); +// -- Test envelope -- +var enveloped = turf.envelope(polygons); + +// -- Test extent -- +var bbox = turf.extent(polygons); + +// -- Test lineDistance +var length = turf.lineDistance(line, 'miles'); + +// -- Test midpoint -- +var midpointed = turf.midpoint(point1, point2); + +// -- Test pointOnSurface -- +var pointOnPolygon = turf.pointOnSurface(polygon); + +// -- Test size -- +var resized = turf.size(bbox, 2); + +// -- Test square -- +var squared = turf.square(bbox); + ////////////////////////////////////////////////////////////////////////// // Tests Transformation ////////////////////////////////////////////////////////////////////////// @@ -104,12 +245,6 @@ var distance = turf.distance(point1, point2, units); // -- Test pointOnLine -- var snapped = turf.pointOnLine(line, point1); -snapped.properties['marker-color'] = '#00f' - -result = { - "type": "FeatureCollection", - "features": [line, point1, snapped] -}; ////////////////////////////////////////////////////////////////////////// // Tests Helper diff --git a/turf/turf.d.ts b/turf/turf.d.ts index 15e9478db..2b0c69c13 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -6,13 +6,13 @@ /// declare module turf { - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// // Aggregation - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// // Measurement - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// /** * Takes a line and returns a point at a specified distance along the line. @@ -29,7 +29,46 @@ declare module turf { * @returns Area in square meters */ function area(input: GeoJSON.Feature | GeoJSON.FeatureCollection): number; - + + /** + * Takes a bbox and returns an equivalent polygon. + * @param bbox An Array of bounding box coordinates in the form: [xLow, yLow, xHigh, yHigh] + * @returns A Polygon representation of the bounding box + */ + function bboxPolygon(bbox: Array): GeoJSON.Feature; + + /** + * Takes two points and finds the geographic bearing between them. + * @param start Starting Point + * @param end Ending point + * @returns Bearing in decimal degrees + */ + function bearing(start: GeoJSON.Feature, end: GeoJSON.Feature): number; + + /** + * Takes a FeatureCollection and returns the absolute center point of all features. + * @param features Input features + * @returns A Point feature at the absolute center point of all input features + */ + function center(features: GeoJSON.FeatureCollection): GeoJSON.Feature; + + /** + * Takes one or more features and calculates the centroid using the arithmetic mean of all vertices. This lessens the effect of small islands and artifacts when calculating the centroid of a set of polygons. + * @param features Input features + * @returns The centroid of the input features + */ + function centroid(features: GeoJSON.Feature | GeoJSON.FeatureCollection): GeoJSON.Feature; + + /** + * Takes a Point and calculates the location of a destination point given a distance in degrees, radians, miles, or kilometers; and bearing in degrees. This uses the Haversine formula to account for global curvature. + * @param start Starting point + * @param distance Distance from the starting point + * @param bearing Ranging from -180 and 180 + * @param units Miles, kilometers, degrees or radians + * @returns Destination point + */ + function destination(start: GeoJSON.Feature, distance: number, bearing: number, units: string): GeoJSON.Feature; + /** * Calculates the distance between two points in degress, radians, miles, or kilometers. This uses the Haversine formula to account for global curvature. * @param from Origin point @@ -39,13 +78,65 @@ declare module turf { */ function distance(from: GeoJSON.Feature, to: GeoJSON.Feature, units?: string): number; - ////////////////////////////////////////////////////////////////////////// - // Transformation - ////////////////////////////////////////////////////////////////////////// + /** + * Takes any number of features and returns a rectangular Polygon that encompasses all vertices. + * @param fc Input features + * @returns A rectangular Polygon feature that encompasses all vertices + */ + function envelope(fc: GeoJSON.FeatureCollection): GeoJSON.Feature; - ////////////////////////////////////////////////////////////////////////// + /** + * Takes a set of features, calculates the extent of all input features, and returns a bounding box. + * @param input Input features + * @returns The bounding box of input given as an array in WSEN order (west, south, east, north) + */ + function extent(input: GeoJSON.Feature | GeoJSON.FeatureCollection): Array; + + /** + * Takes a line and measures its length in the specified units. + * @param line Line to measure + * @param units Can be degrees, radians, miles, or kilometers + * @returns Length of the input line + */ + function lineDistance(line: GeoJSON.Feature, units: string): number; + + /** + * Takes two points and returns a point midway between them. + * @param pt1 First point + * @param pt2 Second point + * @returns A point midway between pt1 and pt2 + */ + function midpoint(pt1: GeoJSON.Feature, pt2: GeoJSON.Feature): GeoJSON.Feature; + + /** + * Takes a feature and returns a Point guaranteed to be on the surface of the feature. Given a Polygon, the point will be in the area of the polygon. Given a LineString, the point will be along the string. Given a Point, the point will the same as the input. + * @param input Any feature or set of features + * @returns A point on the surface of input + */ + function pointOnSurface(input: GeoJSON.Feature | GeoJSON.FeatureCollection): GeoJSON.Feature; + + /** + * Takes a bounding box and returns a new bounding box with a size expanded or contracted by a factor of X. + * @param bbox A bounding box + * @param factor The ratio of the new bbox to the input bbox + * @returns The resized bbox + */ + function size(bbox: Array, factor: number): Array; + + /** + * Takes a bounding box and calculates the minimum square bounding box that would contain the input. + * @param bbox A bounding box + * @returns A square surrounding bbox + */ + function square(bbox: Array): Array; + + ////////////////////////////////////////////////////// + // Transformation + ////////////////////////////////////////////////////// + + ////////////////////////////////////////////////////// // Misc - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// /** * Takes a Point and a LineString and calculates the closest Point on the LineString. @@ -55,27 +146,27 @@ declare module turf { */ function pointOnLine(line: GeoJSON.Feature, point: GeoJSON.Feature): GeoJSON.Feature; - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// // Helper - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// // Data - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// // Interpolation - //////////////////////////////////////////////////////////////////////////; + ////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// // Joins - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// // Classification - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// // Types - ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////// } From bbc2af3a3fc34fb1c64d0596cb8c5f2be7f493b7 Mon Sep 17 00:00:00 2001 From: gcroteau Date: Tue, 24 Nov 2015 20:22:20 -0500 Subject: [PATCH 020/134] Completed the Transformation definitions. --- turf/turf-test.ts | 52 ++++++++++++++++++++++++++++-- turf/turf.d.ts | 82 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 128 insertions(+), 6 deletions(-) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index c248ebda1..85b2c7b9a 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -71,7 +71,7 @@ var polygons = { ] }; -var polygon = { +var polygon1 = { "type": "Feature", "properties": {}, "geometry": { @@ -86,6 +86,26 @@ var polygon = { } }; +var polygon2 = { + "type": "Feature", + "properties": { + "fill": "#00f" + }, + "geometry": { + "type": "Polygon", + "coordinates": [[ + [-122.520217, 45.535693], + [-122.64038, 45.553967], + [-122.720031, 45.526554], + [-122.669906, 45.507309], + [-122.723464, 45.446643], + [-122.532577, 45.408574], + [-122.487258, 45.477466], + [-122.520217, 45.535693] + ]] + } +} + var features = { "type": "FeatureCollection", "features": [ @@ -227,7 +247,7 @@ var length = turf.lineDistance(line, 'miles'); var midpointed = turf.midpoint(point1, point2); // -- Test pointOnSurface -- -var pointOnPolygon = turf.pointOnSurface(polygon); +var pointOnPolygon = turf.pointOnSurface(polygon1); // -- Test size -- var resized = turf.size(bbox, 2); @@ -239,6 +259,34 @@ var squared = turf.square(bbox); // Tests Transformation ////////////////////////////////////////////////////////////////////////// +// -- Test bezier -- +var curved = turf.bezier(line); + +// -- Test buffer -- +var buffered = turf.buffer(point1, 500, units); + +// -- Test concave -- +var hull = turf.concave(features, 1, 'miles'); + +// -- Test convex -- +var hull = turf.convex(features); + +// -- Test difference -- +var differenced = turf.difference(polygon1, polygon2); + +// -- Test intersect -- +var intersection = turf.intersect(polygon1, polygon2); + +// -- Test merge -- +var merged = turf.merge(polygons); + +// -- Test simplify -- +var tolerance = 0.01; +var simplified = turf.simplify(polygon1, tolerance, false); + +// -- Test union -- +var union = turf.union(polygon1, polygon2); + ////////////////////////////////////////////////////////////////////////// // Tests Misc ////////////////////////////////////////////////////////////////////////// diff --git a/turf/turf.d.ts b/turf/turf.d.ts index 2b0c69c13..77bba0c74 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -18,7 +18,7 @@ declare module turf { * Takes a line and returns a point at a specified distance along the line. * @param line Input line * @param distance Distance along the line - * @param [units=miles] Can be degrees, radians, miles, or kilometers. Default is miles + * @param [units=miles] 'miles', 'feet', 'kilometers', 'meters', or 'degrees' * @returns Point along the line */ function along(line: GeoJSON.Feature, distance: number, units?: string): GeoJSON.Feature; @@ -64,7 +64,7 @@ declare module turf { * @param start Starting point * @param distance Distance from the starting point * @param bearing Ranging from -180 and 180 - * @param units Miles, kilometers, degrees or radians + * @param units 'miles', 'feet', 'kilometers', 'meters', or 'degrees' * @returns Destination point */ function destination(start: GeoJSON.Feature, distance: number, bearing: number, units: string): GeoJSON.Feature; @@ -73,7 +73,7 @@ declare module turf { * Calculates the distance between two points in degress, radians, miles, or kilometers. This uses the Haversine formula to account for global curvature. * @param from Origin point * @param to Destination point - * @param [units=kilometers] Can be degrees, radians, miles, or kilometers. Default is kilometers. + * @param [units=kilometers] 'miles', 'feet', 'kilometers', 'meters', or 'degrees' * @returns Distance between the two points */ function distance(from: GeoJSON.Feature, to: GeoJSON.Feature, units?: string): number; @@ -95,7 +95,7 @@ declare module turf { /** * Takes a line and measures its length in the specified units. * @param line Line to measure - * @param units Can be degrees, radians, miles, or kilometers + * @param units 'miles', 'feet', 'kilometers', 'meters', or 'degrees' * @returns Length of the input line */ function lineDistance(line: GeoJSON.Feature, units: string): number; @@ -134,6 +134,80 @@ declare module turf { // Transformation ////////////////////////////////////////////////////// + /** + * Takes a line and returns a curved version by applying a Bezier spline algorithm. The bezier spline implementation is by Leszek Rybicki. + * @param line Input LineString + * @param [resolution=10000] Time in milliseconds between points + * @param [sharpness=0.85] A measure of how curvy the path should be between splines + * @returns Curved line + */ + function bezier(line: GeoJSON.Feature, resolution?: number, sharpness?: number): GeoJSON.Feature; + + /** + * Calculates a buffer for input features for a given radius. Units supported are miles, kilometers, and degrees. + * @param feature Input to be buffered + * @param distance Distance to draw the buffer + * @param units 'miles', 'feet', 'kilometers', 'meters', or 'degrees' + * @returns Buffered features + */ + function buffer(feature: GeoJSON.Feature | GeoJSON.FeatureCollection, distance: number, units: string): GeoJSON.Feature | GeoJSON.FeatureCollection; + + /** + * Takes a set of points and returns a concave hull polygon. Internally, this implements a Monotone chain algorithm. + * @param points Input points + * @param maxEdge The size of an edge necessary for part of the hull to become concave (in miles) + * @param units Used for maxEdge distance (miles or kilometers) + * @returns A concave hull + */ + function concave(points: GeoJSON.FeatureCollection, maxEdge: number, units: string): GeoJSON.Feature; + + /** + * Takes a set of points and returns a convex hull polygon. Internally this uses the convex-hull module that implements a monotone chain hull. + * @param input Input points + * @returns A convex hull + */ + function convex(points: GeoJSON.FeatureCollection): GeoJSON.Feature; + + /** + * Finds the difference between two polygons by clipping the second polygon from the first. + * @param poly1 Input Polygon feaure + * @param poly2 Polygon feature to difference from poly1 + * @returns A Polygon feature showing the area of poly1 excluding the area of poly2 + */ + function difference(poly1: GeoJSON.Feature, poly2: GeoJSON.Feature): GeoJSON.Feature; + + /** + * Takes two polygons and finds their intersection. If they share a border, returns the border; if they don't intersect, returns undefined. + * @param poly1 The first polygon + * @param poly2 The second polygon + * @returns If poly1 and poly2 overlap, returns a Polygon feature representing the area they overlap; if poly1 and poly2 do not overlap, returns undefined; if poly1 and poly2 share a border, a MultiLineString of the locations where their borders are shared + */ + function intersect(poly1: GeoJSON.Feature, poly2: GeoJSON.Feature): GeoJSON.Feature; + + /** + * Takes a set of polygons and returns a single merged polygon feature. If the input polygon features are not contiguous, this function returns a MultiPolygon feature. + * @param fc Input polygons + * @returns Merged polygon or multipolygon + */ + function merge(fc: GeoJSON.FeatureCollection): GeoJSON.Feature; + + /** + * Takes a LineString or Polygon and returns a simplified version. Internally uses simplify-js to perform simplification. + * @param feature Feature to be simplified + * @param tolerance Simplification tolerance + * @param highQuality Whether or not to spend more time to create a higher-quality simplification with a different algorithm + * @returns A simplified feature + */ + function simplify(feature: GeoJSON.Feature | GeoJSON.FeatureCollection | GeoJSON.GeometryCollection, tolerance: number, highQuality: boolean): GeoJSON.Feature | GeoJSON.FeatureCollection | GeoJSON.GeometryCollection; + + /** + * Takes two polygons and returns a combined polygon. If the input polygons are not contiguous, this function returns a MultiPolygon feature. + * @param poly1 Input polygon + * @param poly2 Another input polygon + * @returns A combined Polygon or MultiPolygon feature + */ + function union(poly1: GeoJSON.Feature, poly2: GeoJSON.Feature): GeoJSON.Feature; + ////////////////////////////////////////////////////// // Misc ////////////////////////////////////////////////////// From bd95f700d11867f1f18f1faaf6675906f5fa6c27 Mon Sep 17 00:00:00 2001 From: gcroteau Date: Tue, 24 Nov 2015 21:57:25 -0500 Subject: [PATCH 021/134] Completed the Misc definitions. --- turf/turf-test.ts | 17 ++++++++++++++++- turf/turf.d.ts | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index 85b2c7b9a..b053e761e 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -222,7 +222,7 @@ var bearing = turf.bearing(point1, point2); var centerPt = turf.center(features); // -- Test centroid -- -var centroidPt = turf.centroid(poly); +var centroidPt = turf.centroid(polygon1); // -- Test destination -- var distance = 50; @@ -291,6 +291,21 @@ var union = turf.union(polygon1, polygon2); // Tests Misc ////////////////////////////////////////////////////////////////////////// +// -- Test combine -- +var combined = turf.combine(features); + +// -- Test explode -- +var points = turf.explode(polygon1); + +// -- Test flip -- +var flipedPoint = turf.flip(point1); + +// -- Test kinks -- +var kinks = turf.kinks(polygon1); + +// -- Test lineSlice -- +var sliced = turf.lineSlice(point1, point2, line); + // -- Test pointOnLine -- var snapped = turf.pointOnLine(line, point1); diff --git a/turf/turf.d.ts b/turf/turf.d.ts index 77bba0c74..fb479ae34 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -212,6 +212,43 @@ declare module turf { // Misc ////////////////////////////////////////////////////// + /** + * Combines a FeatureCollection of Point, LineString, or Polygon features into MultiPoint, MultiLineString, or MultiPolygon features. + * @param fc A FeatureCollection of any type + * @returns A FeatureCollection of corresponding type to input + */ + function combine(fc: GeoJSON.FeatureCollection): GeoJSON.FeatureCollection; + + /** + * Takes a feature or set of features and returns all positions as points. + * @param input Input features + * @returns Points representing the exploded input features + */ + function explode(input: GeoJSON.Feature | GeoJSON.FeatureCollection): GeoJSON.FeatureCollection; + + /** + * Takes input features and flips all of their coordinates from [x, y] to [y, x]. + * @param input Input features + * @returns A feature or set of features of the same type as input with flipped coordinates + */ + function flip(input: GeoJSON.Feature | GeoJSON.FeatureCollection): GeoJSON.Feature | GeoJSON.FeatureCollection; + + /** + * Takes a polygon and returns points at all self-intersections. + * @param polygon Input polygon + * @returns Self-intersections + */ + function kinks(polygon: GeoJSON.Feature): GeoJSON.FeatureCollection; + + /** + * Takes a line, a start Point, and a stop point and returns the line in between those points. + * @param point1 Starting point + * @param point2 Stopping point + * @param line Line to slice + * @returns Sliced line + */ + function lineSlice(point1: GeoJSON.Feature, point2: GeoJSON.Feature, line: GeoJSON.Feature): GeoJSON.Feature; + /** * Takes a Point and a LineString and calculates the closest Point on the LineString. * @param line Line to snap to From 4d5969f17cd9411d5bf5d87eba035ecd012a48d2 Mon Sep 17 00:00:00 2001 From: gcroteau Date: Tue, 24 Nov 2015 22:47:30 -0500 Subject: [PATCH 022/134] Completed the Helper definitions. --- turf/turf-test.ts | 30 ++++++++++++++++++++++++++++++ turf/turf.d.ts | 31 +++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index b053e761e..296542868 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -313,6 +313,36 @@ var snapped = turf.pointOnLine(line, point1); // Tests Helper ////////////////////////////////////////////////////////////////////////// +// -- Test featurecollection -- +var fc = turf.featurecollection([point1, point2]); + +// -- Test linestring -- +var linestring1 = turf.linestring([ + [-21.964416, 64.148203], + [-21.956176, 64.141316], + [-21.93901, 64.135924], + [-21.927337, 64.136673] +]); +var linestring2 = turf.linestring([ + [-21.929054, 64.127985], + [-21.912918, 64.134726], + [-21.916007, 64.141016], + [-21.930084, 64.14446] +], {name: 'line 1', distance: 145}); + +// -- Test point -- +var pt1 = turf.point([-75.343, 39.984]); +var pt2 = turf.point([-75.343, 39.984], {name: 'point 1', distance: 145}); + +// -- Test polygon -- +var polygon = turf.polygon([[ + [-2.275543, 53.464547], + [-2.275543, 53.489271], + [-2.215118, 53.489271], + [-2.215118, 53.464547], + [-2.275543, 53.464547] +]], { name: 'poly1', population: 400}); + ////////////////////////////////////////////////////////////////////////// // Tests Data ////////////////////////////////////////////////////////////////////////// diff --git a/turf/turf.d.ts b/turf/turf.d.ts index fb479ae34..0f6868630 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -261,6 +261,37 @@ declare module turf { // Helper ////////////////////////////////////////////////////// + /** + * Takes one or more Features and creates a FeatureCollection. + * @param features Input features + * @returns A FeatureCollection of input features + */ + function featurecollection(features: Array): GeoJSON.FeatureCollection; + + /** + * Creates a LineString based on a coordinate array. Properties can be added optionally. + * @param coordinates An array of Positions + * @param [properties] An Object of key-value pairs to add as properties + * @returns A LineString feature + */ + function linestring(coordinates: Array>, properties?: any): GeoJSON.Feature; + + /** + * Takes coordinates and properties (optional) and returns a new Point feature. + * @param coordinates Longitude, latitude position (each in decimal degrees) + * @param [properties] An Object of key-value pairs to add as properties + * @returns A Point feature + */ + function point(coordinates: Array, properties?: any): GeoJSON.Feature; + + /** + * Takes an array of LinearRings and optionally an Object with properties and returns a Polygon feature. + * @param rings An array of LinearRings + * @param [properties] An Object of key-value pairs to add as properties + * @returns A Polygon feature + */ + function polygon(rings: Array>>, properties?: any): GeoJSON.Feature; + ////////////////////////////////////////////////////// // Data ////////////////////////////////////////////////////// From b5b7ec2ce07a810c2d19a111196e2753197e733e Mon Sep 17 00:00:00 2001 From: gcroteau Date: Tue, 24 Nov 2015 23:44:45 -0500 Subject: [PATCH 023/134] Added filter definition. --- turf/turf-test.ts | 5 +++++ turf/turf.d.ts | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index 296542868..4d89f140e 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -347,6 +347,11 @@ var polygon = turf.polygon([[ // Tests Data ////////////////////////////////////////////////////////////////////////// +// -- Test filter -- +var key = "species"; +var value = "oak"; +var filtered = turf.filter(features, key, value); + ////////////////////////////////////////////////////////////////////////// // Tests Interpolation //////////////////////////////////////////////////////////////////////////; diff --git a/turf/turf.d.ts b/turf/turf.d.ts index 0f6868630..85d7b25f9 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -296,6 +296,15 @@ declare module turf { // Data ////////////////////////////////////////////////////// + /** + * Takes a FeatureCollection and filters it by a given property and value. + * @param features Input features + * @param key The property on which to filter + * @param value The value of that property on which to filter + * @returns A filtered collection with only features that match input key and value + */ + function filter(features: GeoJSON.FeatureCollection, key: string, value: string): GeoJSON.FeatureCollection; + ////////////////////////////////////////////////////// // Interpolation ////////////////////////////////////////////////////// From 9ce1cff36fceab03314c25d0513f23b7d8453cb7 Mon Sep 17 00:00:00 2001 From: gcroteau Date: Wed, 25 Nov 2015 17:08:37 -0500 Subject: [PATCH 024/134] Completed Data definitions. --- turf/turf-test.ts | 18 ++++++++++++++++++ turf/turf.d.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index 4d89f140e..a69d36d47 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -352,6 +352,24 @@ var key = "species"; var value = "oak"; var filtered = turf.filter(features, key, value); +// -- Test random -- +var points = turf.random('points', 100, { + bbox: [-70, 40, -60, 60] +}); + +var points = turf.random('points', 100, { + bbox: [-70, 40, -60, 60], + num_vertices: 2, + max_radial_length: 10 +}); + +// -- Test remove -- +var filtered = turf.remove(points, 'marker-color', '#00f'); + +// -- Test sample -- +var points = turf.random('points', 1000); +var sample = turf.sample(points, 10); + ////////////////////////////////////////////////////////////////////////// // Tests Interpolation //////////////////////////////////////////////////////////////////////////; diff --git a/turf/turf.d.ts b/turf/turf.d.ts index 85d7b25f9..c10fe2ac9 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -305,6 +305,35 @@ declare module turf { */ function filter(features: GeoJSON.FeatureCollection, key: string, value: string): GeoJSON.FeatureCollection; + /** + * Generates random GeoJSON data, including Points and Polygons, for testing and experimentation. + * @param [type='point'] Type of features desired: 'points' or 'polygons' + * @param [count=1] How many geometries should be generated. + * @param [options] Options relevant to the feature desired. Can include: + * - A bounding box inside of which geometries are placed. In the case of Point features, they are guaranteed to be within this bounds, while Polygon features have their centroid within the bounds. + * - The number of vertices added to polygon features. Default is 10; + * - The total number of decimal degrees longitude or latitude that a polygon can extent outwards to from its center. Default is 10. + * @returns Generated random features + */ + function random(type?: string, count?: number, options?: {bbox?: Array; num_vertices?: number; max_radial_length?: number;}): GeoJSON.FeatureCollection; + + /** + * Takes a FeatureCollection of any type, a property, and a value and returns a FeatureCollection with features matching that property-value pair removed. + * @param features Set of input features + * @param property The property to remove + * @param value The value to remove + * @returns The resulting FeatureCollection without features that match the property-value pair + */ + function remove(features: GeoJSON.FeatureCollection, property: string, value: string): GeoJSON.FeatureCollection; + + /** + * Takes a FeatureCollection and returns a FeatureCollection with given number of features at random. + * @param features Set of input features + * @param n Number of features to select + * @returns A FeatureCollection with n features + */ + function sample(features: GeoJSON.FeatureCollection, n: number): GeoJSON.FeatureCollection; + ////////////////////////////////////////////////////// // Interpolation ////////////////////////////////////////////////////// From ab3aa41ff74a961268a1ebe7aee2218e099bb4d9 Mon Sep 17 00:00:00 2001 From: gcroteau Date: Wed, 25 Nov 2015 19:47:29 -0500 Subject: [PATCH 025/134] Added Interpolation definitions to turf.d.ts. --- turf/turf-test.ts | 43 +++++++++++++++++++++++++++++++ turf/turf.d.ts | 64 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index a69d36d47..e8aaec708 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -197,6 +197,24 @@ var features = { ] }; +var triangle = { + "type": "Feature", + "properties": { + "a": 11, + "b": 122, + "c": 44 + }, + "geometry": { + "type": "Polygon", + "coordinates": [[ + [-75.1221, 39.57], + [-75.58, 39.18], + [-75.97, 39.86], + [-75.1221, 39.57] + ]] + } +}; + ////////////////////////////////////////////////////////////////////////// // Tests Aggregation ////////////////////////////////////////////////////////////////////////// @@ -374,6 +392,31 @@ var sample = turf.sample(points, 10); // Tests Interpolation //////////////////////////////////////////////////////////////////////////; +// -- Test hexGrid -- +var cellWidth = 50; +var hexgrid = turf.hexGrid(bbox, cellWidth, units); + +// -- Test isolines -- +var breaks = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +var isolined = turf.isolines(points, 'z', 15, breaks); + +// -- Test planepoint -- +var zValue = turf.planepoint(point1, triangle); + +// -- Test pointGrid -- +var extent = [-70.823364, -33.553984, -70.473175, -33.302986]; +var cellWidth = 3; +var grid = turf.pointGrid(extent, cellWidth, units); + +// -- Test squareGrid -- +var squareGrid = turf.squareGrid(extent, cellWidth, units); + +// -- Test tin -- +var tin = turf.tin(points, 'z'); + +// -- Test triangleGrid -- +var triangleGrid = turf.triangleGrid(extent, cellWidth, units); + ////////////////////////////////////////////////////////////////////////// // Tests Joins ////////////////////////////////////////////////////////////////////////// diff --git a/turf/turf.d.ts b/turf/turf.d.ts index c10fe2ac9..b74681a89 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -338,6 +338,70 @@ declare module turf { // Interpolation ////////////////////////////////////////////////////// + /** + * Takes a bounding box and a cell size in degrees and returns a FeatureCollection of flat-topped hexagons (Polygon features) aligned in an "odd-q" vertical grid as described in Hexagonal Grids. + * @param bbox Bounding box in [minX, minY, maxX, maxY] order + * @param cellWidth Width of cell in specified units + * @param units Used in calculating cellWidth ('miles' or 'kilometers') + * @returns A hexagonal grid + */ + function hexGrid(bbox: Array, cellWidth: number, units: string): GeoJSON.FeatureCollection; + + /** + * Takes points with z-values and an array of value breaks and generates isolines. + * @param points Input points + * @param z The property name in points from which z-values will be pulled + * @param resolution Resolution of the underlying grid + * @param breaks Where to draw contours + * @returns Isolines + */ + function isolines(points: GeoJSON.FeatureCollection, z: string, resolution: number, breaks: Array): GeoJSON.FeatureCollection; + + /** + * Takes a triangular plane as a Polygon and a Point within that triangle and returns the z-value at that point. The Polygon needs to have properties a, b, and c that define the values at its three corners. + * @param interpolatedPoint The Point for which a z-value will be calculated + * @param triangle A Polygon feature with three vertices + * @returns The z-value for interpolatedPoint + */ + function planepoint(interpolatedPoint: GeoJSON.Feature, triangle: GeoJSON.Feature): number; + + /** + * Takes a bounding box and a cell depth and returns a set of points in a grid. + * @param extent Extent in [minX, minY, maxX, maxY] order + * @param cellWidth The distance across each cell + * @param units Used in calculating cellWidth ('miles' or 'kilometers') + * @returns Grid of points + */ + function pointGrid(extent: Array, cellWidth: number, units: string): GeoJSON.FeatureCollection; + + /** + * Takes a bounding box and a cell depth and returns a set of square polygons in a grid. + * @param extent Extent in [minX, minY, maxX, maxY] order + * @param cellWidth Width of each cell + * @param units Used in calculating cellWidth ('miles' or 'kilometers') + * @returns Grid of polygons + */ + function squareGrid(extent: Array, cellWidth: number, units: string): GeoJSON.FeatureCollection; + + /** + * Takes a set of points and the name of a z-value property and creates a Triangulated Irregular Network, or a TIN for short, returned as a collection of Polygons. + * These are often used for developing elevation contour maps or stepped heat visualizations. + * This triangulates the points, as well as adds properties called a, b, and c representing the value of the given propertyName at each of the points that represent the corners of the triangle. + * @param points Input points + * @param [propertyName] Name of the property from which to pull z values This is optional: if not given, then there will be no extra data added to the derived triangles. + * @returns TIN output + */ + function tin(points: GeoJSON.FeatureCollection, propertyName?: string): GeoJSON.FeatureCollection; + + /** + * Takes a bounding box and a cell depth and returns a set of triangular polygons in a grid. + * @param extent Extent in [minX, minY, maxX, maxY] order + * @param cellWidth Width of each cell + * @param units Used in calculating cellWidth ('miles' or 'kilometers') + * @returns Grid of triangles + */ + function triangleGrid(extent: Array, cellWidth: number, units: string): GeoJSON.FeatureCollection; + ////////////////////////////////////////////////////// // Joins ////////////////////////////////////////////////////// From 1c55a6117750de906e301ff3a39204844f3a1069 Mon Sep 17 00:00:00 2001 From: gcroteau Date: Wed, 25 Nov 2015 19:56:27 -0500 Subject: [PATCH 026/134] Added Joins definitions to turf.d.ts. --- turf/turf-test.ts | 9 +++++++++ turf/turf.d.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index e8aaec708..d46bf2e81 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -421,6 +421,15 @@ var triangleGrid = turf.triangleGrid(extent, cellWidth, units); // Tests Joins ////////////////////////////////////////////////////////////////////////// +// -- Test inside -- +var isInside1 = turf.inside(point1, polygon); + +// -- Test tag -- +var tagged = turf.tag(points, triangleGrid, 'fill', 'marker-color'); + +// -- Test within -- +var ptsWithin = turf.within(points, polygons); + ////////////////////////////////////////////////////////////////////////// // Tests Classification ////////////////////////////////////////////////////////////////////////// diff --git a/turf/turf.d.ts b/turf/turf.d.ts index b74681a89..f90668b4f 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -406,6 +406,32 @@ declare module turf { // Joins ////////////////////////////////////////////////////// + /** + * Takes a Point and a Polygon or MultiPolygon and determines if the point resides inside the polygon. The polygon can be convex or concave. The function accounts for holes. + * @param point Input point + * @param polygon Input polygon or multipolygon + * @returns true if the Point is inside the Polygon; false if the Point is not inside the Polygon + */ + function inside(point: GeoJSON.Feature, polygon: GeoJSON.Feature): boolean; + + /** + * Takes a set of points and a set of polygons and performs a spatial join. + * @param points Input points + * @param polygons Input polygons + * @param polyId Property in polygons to add to joined Point features + * @param containingPolyId Property in points in which to store joined property from polygons + * @returns Points with containingPolyId property containing values from polyId + */ + function tag(points: GeoJSON.FeatureCollection, polygons: GeoJSON.FeatureCollection, polyId: string, containingPolyId: string): GeoJSON.FeatureCollection; + + /** + * Takes a set of points and a set of polygons and returns the points that fall within the polygons. + * @param points Input points + * @param polygons Input polygons + * @returns Points that land within at least one polygon + */ + function within(points: GeoJSON.FeatureCollection, polygons: GeoJSON.FeatureCollection): GeoJSON.FeatureCollection; + ////////////////////////////////////////////////////// // Classification ////////////////////////////////////////////////////// From 77365e3b156e2230e735a1aeec914bcfe9281dd4 Mon Sep 17 00:00:00 2001 From: gcroteau Date: Wed, 25 Nov 2015 20:11:13 -0500 Subject: [PATCH 027/134] Added Classification definitions to turf.d.ts. --- turf/turf-test.ts | 17 +++++++++++++++++ turf/turf.d.ts | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index d46bf2e81..5a8501c74 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -433,3 +433,20 @@ var ptsWithin = turf.within(points, polygons); ////////////////////////////////////////////////////////////////////////// // Tests Classification ////////////////////////////////////////////////////////////////////////// + +// -- Test jenks -- +var breaks = turf.jenks(points, 'population', 3); + +// -- Test nearest -- +var nearest = turf.nearest(point1, points); + +// -- Test quantile -- +var breaks = turf.quantile(points, 'population', [25, 50, 75, 99]); + +// -- Test reclass -- +var translations = [ + [0, 200, "small"], + [200, 400, "medium"], + [400, 600, "large"] +]; +var reclassed = turf.reclass(points, 'population', 'size', translations); diff --git a/turf/turf.d.ts b/turf/turf.d.ts index f90668b4f..0da75e33b 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -436,7 +436,39 @@ declare module turf { // Classification ////////////////////////////////////////////////////// - ////////////////////////////////////////////////////// - // Types - ////////////////////////////////////////////////////// + /** + * Takes a set of features and returns an array of the Jenks Natural breaks for a given property. + * @param input Input features + * @param field The property in input on which to calculate Jenks natural breaks + * @param numberOfBreaks Number of classes in which to group the data + * @returns The break number for each class plus the minimum and maximum values + */ + function jenks(input: GeoJSON.FeatureCollection, field: string, numberOfBreaks: number): Array; + + /** + * Takes a reference point and a set of points and returns the point from the set closest to the reference. + * @param point The reference point + * @param against Input point set + * @returns The closest point in the set to the reference point + */ + function nearest(point: GeoJSON.Feature, against: GeoJSON.FeatureCollection): GeoJSON.Feature; + + /** + * Takes a FeatureCollection, a property name, and a set of percentiles and returns a quantile array. + * @param input Set of features + * @param field The property in input from which to retrieve quantile values + * @param percentiles An Array of percentiles on which to calculate quantile values + * @returns An array of the break values + */ + function quantile(input: GeoJSON.FeatureCollection, field: string, percentiles: Array): Array; + + /** + * Takes a FeatureCollection, an input field, an output field, and an array of translations and outputs an identical FeatureCollection with the output field property populated. + * @param input Set of input features + * @param inField The field to translate + * @param outField The field in which to store translated results + * @param translations An array of translations + * @returns A FeatureCollection with identical geometries to input but with outField populated. + */ + function reclass(input: GeoJSON.FeatureCollection, inField: string, outField: string, translations: Array): GeoJSON.FeatureCollection; } From 3ea58099e4095399e4c1c79177876637dd3bbf99 Mon Sep 17 00:00:00 2001 From: Sabeeh Ul Hussnain Date: Fri, 27 Nov 2015 08:38:28 +0500 Subject: [PATCH 028/134] test updated and file renamed --- lobibox/{lobibox.js-test.ts => lobibox.js-tests.ts} | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) rename lobibox/{lobibox.js-test.ts => lobibox.js-tests.ts} (97%) diff --git a/lobibox/lobibox.js-test.ts b/lobibox/lobibox.js-tests.ts similarity index 97% rename from lobibox/lobibox.js-test.ts rename to lobibox/lobibox.js-tests.ts index bd0ff33d2..c5fe295a8 100644 --- a/lobibox/lobibox.js-test.ts +++ b/lobibox/lobibox.js-tests.ts @@ -5,7 +5,7 @@ /// - //Run test : LobiboxTest.test() + //Run test : LobiboxTest.test() after window load event class LobiboxTest { static test() { // extending default parameters @@ -138,3 +138,7 @@ class LobiboxTest { }); } } + +window.onload = (): void => { + Notify.error("test"); +}; From 33663d7a9ff040cbe309c8607c0e540adeaaca71 Mon Sep 17 00:00:00 2001 From: Sabeeh Ul Hussnain Date: Fri, 27 Nov 2015 08:41:41 +0500 Subject: [PATCH 029/134] test updated and file renamed --- lobibox/lobibox.js-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lobibox/lobibox.js-tests.ts b/lobibox/lobibox.js-tests.ts index c5fe295a8..78637114a 100644 --- a/lobibox/lobibox.js-tests.ts +++ b/lobibox/lobibox.js-tests.ts @@ -140,5 +140,5 @@ class LobiboxTest { } window.onload = (): void => { - Notify.error("test"); + LobiboxTest.test(); }; From 36b68a0023358c4c39ff49a9b330639e5c662a0f Mon Sep 17 00:00:00 2001 From: gcroteau Date: Thu, 26 Nov 2015 23:28:51 -0500 Subject: [PATCH 030/134] Added Aggregation definitions to turf.d.ts. --- turf/turf-test.ts | 70 +++++++++++++++++++++++++++++++++++++ turf/turf.d.ts | 88 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index 5a8501c74..a6bb7e2ac 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -215,10 +215,80 @@ var triangle = { } }; +var aggregations = [ + { + aggregation: 'sum', + inField: 'population', + outField: 'pop_sum' + }, + { + aggregation: 'average', + inField: 'population', + outField: 'pop_avg' + }, + { + aggregation: 'median', + inField: 'population', + outField: 'pop_median' + }, + { + aggregation: 'min', + inField: 'population', + outField: 'pop_min' + }, + { + aggregation: 'max', + inField: 'population', + outField: 'pop_max' + }, + { + aggregation: 'deviation', + inField: 'population', + outField: 'pop_deviation' + }, + { + aggregation: 'variance', + inField: 'population', + outField: 'pop_variance' + }, + { + aggregation: 'count', + inField: '', + outField: 'point_count' + } +]; + ////////////////////////////////////////////////////////////////////////// // Tests Aggregation ////////////////////////////////////////////////////////////////////////// +// -- Test aggregate -- +var aggregated = turf.aggregate(polygons, points, aggregations); + +// -- Test average -- +var averaged = turf.average(polygons, points, 'population', 'pop_avg'); + +// -- Test count -- +var counted = turf.count(polygons, points, 'pt_count'); + +// -- Test deviation -- +var deviated = turf.deviation(polygons, points, 'population', 'pop_deviation'); + +// -- Test max -- +var aggregated = turf.max(polygons, points, 'population', 'max'); + +// -- Test median -- +var medians = turf.median(polygons, points, 'population', 'median'); + +// -- Test min -- +var minimums = turf.min(polygons, points, 'population', 'min'); + +// -- Test sum -- +var summed = turf.sum(polygons, points, 'population', 'sum'); + +// -- Test variance -- +var varianced = turf.variance(polygons, points, 'population', 'variance'); + ////////////////////////////////////////////////////////////////////////// // Tests Measurement ////////////////////////////////////////////////////////////////////////// diff --git a/turf/turf.d.ts b/turf/turf.d.ts index 0da75e33b..bbc84eac3 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -10,6 +10,94 @@ declare module turf { // Aggregation ////////////////////////////////////////////////////// + /** + * Calculates a series of aggregations for a set of points within a set of polygons. Sum, average, count, min, max, and deviation are supported. + * @param polygons Polygons with values on which to aggregate + * @param points Points to be aggregated + * @param aggregations An array of aggregation objects + * @returns Polygons with properties listed based on outField values in aggregations + */ + function aggregate(polygons: GeoJSON.FeatureCollection, points: GeoJSON.FeatureCollection, aggregations: Array<{aggregation: string, inField: string, outField: string}>): GeoJSON.FeatureCollection; + + /** + * Calculates the average value of a field for a set of points within a set of polygons. + * @param polygons Polygons with values on which to average + * @param points Points from which to calculate the average + * @param field The field in the points features from which to pull values to average + * @param outField The field in polygons to put results of the averages + * @returns Polygons with the value of outField set to the calculated averages + */ + function average(polygons: GeoJSON.FeatureCollection, points: GeoJSON.FeatureCollection, field: string, outField: string): GeoJSON.FeatureCollection; + + /** + * Takes a set of points and a set of polygons and calculates the number of points that fall within the set of polygons. + * @param polygons Input polygons + * @param points Input points + * @param countField A field to append to the attributes of the Polygon features representing Point counts + * @returns Polygons with countField appended + */ + function count(polygons: GeoJSON.FeatureCollection, points: GeoJSON.FeatureCollection, countField: string): GeoJSON.FeatureCollection; + + /** + * Calculates the standard deviation value of a field for a set of points within a set of polygons. + * @param polygons Input polygons + * @param points Input points + * @param inField The field in points from which to aggregate + * @param outField The field to append to polygons representing deviation + * @returns Polygons with appended field representing deviation + */ + function deviation(polygons: GeoJSON.FeatureCollection, points: GeoJSON.FeatureCollection, inField: string, outField: string): GeoJSON.FeatureCollection; + + /** + * Calculates the maximum value of a field for a set of points within a set of polygons. + * @param polygons Input polygons + * @param points Input points + * @param inField The field in input data to analyze + * @param outField The field in which to store results + * @returns Polygons with properties listed as outField values + */ + function max(polygons: GeoJSON.FeatureCollection, points: GeoJSON.FeatureCollection, inField: string, outField: string): GeoJSON.FeatureCollection; + + /** + * Calculates the median value of a field for a set of points within a set of polygons. + * @param polygons Input polygons + * @param points Input points + * @param inField The field in input data to analyze + * @param outField The field in which to store results + * @returns Polygons with properties listed as outField values + */ + function median(polygons: GeoJSON.FeatureCollection, points: GeoJSON.FeatureCollection, inField: string, outField: string): GeoJSON.FeatureCollection; + + /** + * Calculates the minimum value of a field for a set of points within a set of polygons. + * @param polygons Input polygons + * @param points Input points + * @param inField The field in input data to analyze + * @param outField The field in which to store results + * @returns Polygons with properties listed as outField values + */ + function min(polygons: GeoJSON.FeatureCollection, points: GeoJSON.FeatureCollection, inField: string, outField: string): GeoJSON.FeatureCollection; + + /** + * Calculates the sum of a field for a set of points within a set of polygons. + * @param polygons Input polygons + * @param points Input points + * @param inField The field in input data to analyze + * @param outField The field in which to store results + * @returns Polygons with properties listed as outField + */ + function sum(polygons: GeoJSON.FeatureCollection, points: GeoJSON.FeatureCollection, inField: string, outField: string): GeoJSON.FeatureCollection; + + /** + * Calculates the variance value of a field for a set of points within a set of polygons. + * @param polygons Input polygons + * @param points Input points + * @param inField The field in input data to analyze + * @param outField The field in which to store results + * @returns Polygons with properties listed as outField + */ + function variance(polygons: GeoJSON.FeatureCollection, points: GeoJSON.FeatureCollection, inField: string, outField: string): GeoJSON.FeatureCollection; + ////////////////////////////////////////////////////// // Measurement ////////////////////////////////////////////////////// From 05e7d8d0cdb21c89944f7d7157ac59cb2a2f36e7 Mon Sep 17 00:00:00 2001 From: sodatea Date: Sun, 29 Nov 2015 00:56:20 +0800 Subject: [PATCH 031/134] Update tape-tests to match tape v4.2.2 documentation --- tape/tape-tests.ts | 165 ++++++++++++++++++++++++++++++--------------- 1 file changed, 111 insertions(+), 54 deletions(-) diff --git a/tape/tape-tests.ts b/tape/tape-tests.ts index 2c4e4ec1b..85bb19a6e 100644 --- a/tape/tape-tests.ts +++ b/tape/tape-tests.ts @@ -4,21 +4,16 @@ import tape = require('tape'); -var x: any; -var value: any; -var err: any; -var a: any; -var b: any; -var err: any; -var num: number; var name: string; -var msg: string; -var rs: NodeJS.ReadableStream; - var cb: tape.TestCase; +var opts: tape.TestOptions; var t: tape.Test; +tape(cb); tape(name, cb); +tape(opts, cb); +tape(name, opts, cb); + tape(name, (test: tape.Test) => { t = test; }); @@ -26,29 +21,51 @@ tape(name, (test: tape.Test) => { tape.skip(name, cb); tape.only(name, cb); -rs = tape.createStream(); -rs = tape.createStream(x); -var tx = tape.createHarness(); -tx(name, cb); -tape.skip(name, cb); -tape.only(name, cb); +var sopts: tape.StreamOptions; +var rs: NodeJS.ReadableStream; +rs = tape.createStream(); +rs = tape.createStream(sopts); + + +var htest: typeof tape; +htest = tape.createHarness(); + tape(name, (test: tape.Test) => { + var num: number; + var ms: number; + var value: any; + var actual: any; + var expected: any; + var err: any; + var fn = function() {}; + var msg: string; + + var exceptionExpected: RegExp | (() => void); + test.plan(num); test.end(); + test.end(err); test.fail(msg); test.pass(msg); + test.timeoutAfter(ms); test.skip(msg); + test.ok(value); test.ok(value, msg); + test.true(value); test.true(value, msg); + test.assert(value); test.assert(value, msg); + test.notOk(value); test.notOk(value, msg); + test.false(value); test.false(value, msg); + test.notok(value); test.notok(value, msg); test.error(err, msg); @@ -56,51 +73,91 @@ tape(name, (test: tape.Test) => { test.ifErr(err, msg); test.iferror(err, msg); - test.equal(a, b, msg); - test.equals(a, b, msg); - test.isEqual(a, b, msg); - test.is(a, b, msg); - test.strictEqual(a, b, msg); - test.strictEquals(a, b, msg); + test.equal(actual, expected); + test.equal(actual, expected, msg); + test.equals(actual, expected); + test.equals(actual, expected, msg); + test.isEqual(actual, expected); + test.isEqual(actual, expected, msg); + test.is(actual, expected); + test.is(actual, expected, msg); + test.strictEqual(actual, expected); + test.strictEqual(actual, expected, msg); + test.strictEquals(actual, expected); + test.strictEquals(actual, expected, msg); - test.notEqual(a, b, msg); - test.notEquals(a, b, msg); - test.notStrictEqual(a, b, msg); - test.notStrictEquals(a, b, msg); - test.isNotEqual(a, b, msg); - test.isNot(a, b, msg); - test.not(a, b, msg); - test.doesNotEqual(a, b, msg); - test.notEqual(a, b, msg); - test.isInequal(a, b, msg); + test.notEqual(actual, expected); + test.notEqual(actual, expected, msg); + test.notEquals(actual, expected); + test.notEquals(actual, expected, msg); + test.notStrictEqual(actual, expected); + test.notStrictEqual(actual, expected, msg); + test.notStrictEquals(actual, expected); + test.notStrictEquals(actual, expected, msg); + test.isNotEqual(actual, expected); + test.isNotEqual(actual, expected, msg); + test.isNot(actual, expected); + test.isNot(actual, expected, msg); + test.not(actual, expected); + test.not(actual, expected, msg); + test.doesNotEqual(actual, expected); + test.doesNotEqual(actual, expected, msg); + test.isInequal(actual, expected); + test.isInequal(actual, expected, msg); - test.deepEqual(a, b, msg); - test.deepEquals(a, b, msg); - test.isEquivalent(a, b, msg); - test.same(a, b, msg); + test.deepEqual(actual, expected); + test.deepEqual(actual, expected, msg); + test.deepEquals(actual, expected); + test.deepEquals(actual, expected, msg); + test.isEquivalent(actual, expected); + test.isEquivalent(actual, expected, msg); + test.same(actual, expected); + test.same(actual, expected, msg); - test.notDeepEqual(a, b, msg); - test.notEquivalent(a, b, msg); - test.notDeeply(a, b, msg); - test.notSame(a, b, msg); - test.isNotDeepEqual(a, b, msg); - test.isNotDeeply(a, b, msg); - test.isNotEquivalent(a, b, msg); - test.isInequivalent(a, b, msg); + test.notDeepEqual(actual, expected); + test.notDeepEqual(actual, expected, msg); + test.notEquivalent(actual, expected); + test.notEquivalent(actual, expected, msg); + test.notDeeply(actual, expected); + test.notDeeply(actual, expected, msg); + test.notSame(actual, expected); + test.notSame(actual, expected, msg); + test.isNotDeepEqual(actual, expected); + test.isNotDeepEqual(actual, expected, msg); + test.isNotDeeply(actual, expected); + test.isNotDeeply(actual, expected, msg); + test.isNotEquivalent(actual, expected); + test.isNotEquivalent(actual, expected, msg); + test.isInequivalent(actual, expected); + test.isInequivalent(actual, expected, msg); - test.deepLooseEqual(a, b, msg); - test.looseEqual(a, b, msg); - test.looseEquals(a, b, msg); + test.deepLooseEqual(actual, expected); + test.deepLooseEqual(actual, expected, msg); + test.looseEqual(actual, expected); + test.looseEqual(actual, expected, msg); + test.looseEquals(actual, expected); + test.looseEquals(actual, expected, msg); - test.notDeepLooseEqual(a, b, msg); - test.notLooseEqual(a, b, msg); - test.notLooseEquals(a, b, msg); + test.notDeepLooseEqual(actual, expected); + test.notDeepLooseEqual(actual, expected, msg); + test.notLooseEqual(actual, expected); + test.notLooseEqual(actual, expected, msg); + test.notLooseEquals(actual, expected); + test.notLooseEquals(actual, expected, msg); - test.throws(() => { + test.throws(fn); + test.throws(fn, msg); + test.throws(fn, exceptionExpected); + test.throws(fn, exceptionExpected, msg); - }, value, msg); + test.doesNotThrow(fn); + test.doesNotThrow(fn, msg); + test.doesNotThrow(fn, exceptionExpected); + test.doesNotThrow(fn, exceptionExpected, msg); - test.doesNotThrow(() => { + test.test(name, (st) => { + t = st; + }); - }, value, msg); + test.comment(msg); }); From 25f513d3bf40cc952819d0d6839f4b10bccffef9 Mon Sep 17 00:00:00 2001 From: gcroteau Date: Mon, 30 Nov 2015 10:17:44 -0500 Subject: [PATCH 032/134] Cleaned up the definition file. --- turf/turf-test.ts | 40 ++++++++++++++++++------------------ turf/turf.d.ts | 52 ++++++++++++++++++++++++++++++----------------- 2 files changed, 53 insertions(+), 39 deletions(-) diff --git a/turf/turf-test.ts b/turf/turf-test.ts index a6bb7e2ac..a262b359e 100644 --- a/turf/turf-test.ts +++ b/turf/turf-test.ts @@ -1,8 +1,8 @@ /// -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // Tests data initialisation -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// var point1 = { "type": "Feature", @@ -258,9 +258,9 @@ var aggregations = [ } ]; -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // Tests Aggregation -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // -- Test aggregate -- var aggregated = turf.aggregate(polygons, points, aggregations); @@ -289,9 +289,9 @@ var summed = turf.sum(polygons, points, 'population', 'sum'); // -- Test variance -- var varianced = turf.variance(polygons, points, 'population', 'variance'); -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // Tests Measurement -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // -- Test along -- var along = turf.along(line, 1, 'miles'); @@ -343,9 +343,9 @@ var resized = turf.size(bbox, 2); // -- Test square -- var squared = turf.square(bbox); -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // Tests Transformation -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // -- Test bezier -- var curved = turf.bezier(line); @@ -375,9 +375,9 @@ var simplified = turf.simplify(polygon1, tolerance, false); // -- Test union -- var union = turf.union(polygon1, polygon2); -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // Tests Misc -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // -- Test combine -- var combined = turf.combine(features); @@ -397,9 +397,9 @@ var sliced = turf.lineSlice(point1, point2, line); // -- Test pointOnLine -- var snapped = turf.pointOnLine(line, point1); -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // Tests Helper -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // -- Test featurecollection -- var fc = turf.featurecollection([point1, point2]); @@ -431,9 +431,9 @@ var polygon = turf.polygon([[ [-2.275543, 53.464547] ]], { name: 'poly1', population: 400}); -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // Tests Data -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // -- Test filter -- var key = "species"; @@ -458,9 +458,9 @@ var filtered = turf.remove(points, 'marker-color', '#00f'); var points = turf.random('points', 1000); var sample = turf.sample(points, 10); -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // Tests Interpolation -//////////////////////////////////////////////////////////////////////////; +/////////////////////////////////////////// // -- Test hexGrid -- var cellWidth = 50; @@ -487,9 +487,9 @@ var tin = turf.tin(points, 'z'); // -- Test triangleGrid -- var triangleGrid = turf.triangleGrid(extent, cellWidth, units); -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // Tests Joins -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // -- Test inside -- var isInside1 = turf.inside(point1, polygon); @@ -500,9 +500,9 @@ var tagged = turf.tag(points, triangleGrid, 'fill', 'marker-color'); // -- Test within -- var ptsWithin = turf.within(points, polygons); -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // Tests Classification -////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////// // -- Test jenks -- var breaks = turf.jenks(points, 'population', 3); diff --git a/turf/turf.d.ts b/turf/turf.d.ts index bbc84eac3..07299e766 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -11,7 +11,8 @@ declare module turf { ////////////////////////////////////////////////////// /** - * Calculates a series of aggregations for a set of points within a set of polygons. Sum, average, count, min, max, and deviation are supported. + * Calculates a series of aggregations for a set of points within a set of polygons. + * Sum, average, count, min, max, and deviation are supported. * @param polygons Polygons with values on which to aggregate * @param points Points to be aggregated * @param aggregations An array of aggregation objects @@ -106,7 +107,7 @@ declare module turf { * Takes a line and returns a point at a specified distance along the line. * @param line Input line * @param distance Distance along the line - * @param [units=miles] 'miles', 'feet', 'kilometers', 'meters', or 'degrees' + * @param [units=miles] 'miles', 'kilometers', 'radians' or 'degrees' * @returns Point along the line */ function along(line: GeoJSON.Feature, distance: number, units?: string): GeoJSON.Feature; @@ -141,27 +142,30 @@ declare module turf { function center(features: GeoJSON.FeatureCollection): GeoJSON.Feature; /** - * Takes one or more features and calculates the centroid using the arithmetic mean of all vertices. This lessens the effect of small islands and artifacts when calculating the centroid of a set of polygons. + * Takes one or more features and calculates the centroid using the arithmetic mean of all vertices. + * This lessens the effect of small islands and artifacts when calculating the centroid of a set of polygons. * @param features Input features * @returns The centroid of the input features */ function centroid(features: GeoJSON.Feature | GeoJSON.FeatureCollection): GeoJSON.Feature; /** - * Takes a Point and calculates the location of a destination point given a distance in degrees, radians, miles, or kilometers; and bearing in degrees. This uses the Haversine formula to account for global curvature. + * Takes a Point and calculates the location of a destination point given a distance in degrees, radians, miles, or kilometers; and bearing in degrees. + * This uses the Haversine formula to account for global curvature. * @param start Starting point * @param distance Distance from the starting point * @param bearing Ranging from -180 and 180 - * @param units 'miles', 'feet', 'kilometers', 'meters', or 'degrees' + * @param units 'miles', 'kilometers', 'radians', or 'degrees' * @returns Destination point */ function destination(start: GeoJSON.Feature, distance: number, bearing: number, units: string): GeoJSON.Feature; /** - * Calculates the distance between two points in degress, radians, miles, or kilometers. This uses the Haversine formula to account for global curvature. + * Calculates the distance between two points in degress, radians, miles, or kilometers. + * This uses the Haversine formula to account for global curvature. * @param from Origin point * @param to Destination point - * @param [units=kilometers] 'miles', 'feet', 'kilometers', 'meters', or 'degrees' + * @param [units=kilometers] 'miles', 'kilometers', 'radians', or 'degrees' * @returns Distance between the two points */ function distance(from: GeoJSON.Feature, to: GeoJSON.Feature, units?: string): number; @@ -183,7 +187,7 @@ declare module turf { /** * Takes a line and measures its length in the specified units. * @param line Line to measure - * @param units 'miles', 'feet', 'kilometers', 'meters', or 'degrees' + * @param units 'miles', 'kilometers', 'radians', or 'degrees' * @returns Length of the input line */ function lineDistance(line: GeoJSON.Feature, units: string): number; @@ -197,7 +201,8 @@ declare module turf { function midpoint(pt1: GeoJSON.Feature, pt2: GeoJSON.Feature): GeoJSON.Feature; /** - * Takes a feature and returns a Point guaranteed to be on the surface of the feature. Given a Polygon, the point will be in the area of the polygon. Given a LineString, the point will be along the string. Given a Point, the point will the same as the input. + * Takes a feature and returns a Point guaranteed to be on the surface of the feature. Given a Polygon, the point will be in the area of the polygon. + * Given a LineString, the point will be along the string. Given a Point, the point will the same as the input. * @param input Any feature or set of features * @returns A point on the surface of input */ @@ -223,7 +228,8 @@ declare module turf { ////////////////////////////////////////////////////// /** - * Takes a line and returns a curved version by applying a Bezier spline algorithm. The bezier spline implementation is by Leszek Rybicki. + * Takes a line and returns a curved version by applying a Bezier spline algorithm. + * The bezier spline implementation is by Leszek Rybicki. * @param line Input LineString * @param [resolution=10000] Time in milliseconds between points * @param [sharpness=0.85] A measure of how curvy the path should be between splines @@ -235,7 +241,7 @@ declare module turf { * Calculates a buffer for input features for a given radius. Units supported are miles, kilometers, and degrees. * @param feature Input to be buffered * @param distance Distance to draw the buffer - * @param units 'miles', 'feet', 'kilometers', 'meters', or 'degrees' + * @param units 'miles', 'kilometers', 'radians', or 'degrees' * @returns Buffered features */ function buffer(feature: GeoJSON.Feature | GeoJSON.FeatureCollection, distance: number, units: string): GeoJSON.Feature | GeoJSON.FeatureCollection; @@ -254,7 +260,7 @@ declare module turf { * @param input Input points * @returns A convex hull */ - function convex(points: GeoJSON.FeatureCollection): GeoJSON.Feature; + function convex(input: GeoJSON.FeatureCollection): GeoJSON.Feature; /** * Finds the difference between two polygons by clipping the second polygon from the first. @@ -265,22 +271,27 @@ declare module turf { function difference(poly1: GeoJSON.Feature, poly2: GeoJSON.Feature): GeoJSON.Feature; /** - * Takes two polygons and finds their intersection. If they share a border, returns the border; if they don't intersect, returns undefined. + * Takes two polygons and finds their intersection. + * If they share a border, returns the border; if they don't intersect, returns undefined. * @param poly1 The first polygon * @param poly2 The second polygon - * @returns If poly1 and poly2 overlap, returns a Polygon feature representing the area they overlap; if poly1 and poly2 do not overlap, returns undefined; if poly1 and poly2 share a border, a MultiLineString of the locations where their borders are shared + * @returns If poly1 and poly2 overlap, returns a Polygon feature representing the area they overlap; + * if poly1 and poly2 do not overlap, returns undefined; + * if poly1 and poly2 share a border, a MultiLineString of the locations where their borders are shared */ function intersect(poly1: GeoJSON.Feature, poly2: GeoJSON.Feature): GeoJSON.Feature; /** - * Takes a set of polygons and returns a single merged polygon feature. If the input polygon features are not contiguous, this function returns a MultiPolygon feature. + * Takes a set of polygons and returns a single merged polygon feature. + * If the input polygon features are not contiguous, this function returns a MultiPolygon feature. * @param fc Input polygons * @returns Merged polygon or multipolygon */ function merge(fc: GeoJSON.FeatureCollection): GeoJSON.Feature; /** - * Takes a LineString or Polygon and returns a simplified version. Internally uses simplify-js to perform simplification. + * Takes a LineString or Polygon and returns a simplified version. + * Internally uses simplify-js to perform simplification. * @param feature Feature to be simplified * @param tolerance Simplification tolerance * @param highQuality Whether or not to spend more time to create a higher-quality simplification with a different algorithm @@ -289,7 +300,8 @@ declare module turf { function simplify(feature: GeoJSON.Feature | GeoJSON.FeatureCollection | GeoJSON.GeometryCollection, tolerance: number, highQuality: boolean): GeoJSON.Feature | GeoJSON.FeatureCollection | GeoJSON.GeometryCollection; /** - * Takes two polygons and returns a combined polygon. If the input polygons are not contiguous, this function returns a MultiPolygon feature. + * Takes two polygons and returns a combined polygon. + * If the input polygons are not contiguous, this function returns a MultiPolygon feature. * @param poly1 Input polygon * @param poly2 Another input polygon * @returns A combined Polygon or MultiPolygon feature @@ -446,7 +458,8 @@ declare module turf { function isolines(points: GeoJSON.FeatureCollection, z: string, resolution: number, breaks: Array): GeoJSON.FeatureCollection; /** - * Takes a triangular plane as a Polygon and a Point within that triangle and returns the z-value at that point. The Polygon needs to have properties a, b, and c that define the values at its three corners. + * Takes a triangular plane as a Polygon and a Point within that triangle and returns the z-value at that point. + * The Polygon needs to have properties a, b, and c that define the values at its three corners. * @param interpolatedPoint The Point for which a z-value will be calculated * @param triangle A Polygon feature with three vertices * @returns The z-value for interpolatedPoint @@ -495,7 +508,8 @@ declare module turf { ////////////////////////////////////////////////////// /** - * Takes a Point and a Polygon or MultiPolygon and determines if the point resides inside the polygon. The polygon can be convex or concave. The function accounts for holes. + * Takes a Point and a Polygon or MultiPolygon and determines if the point resides inside the polygon. + * The polygon can be convex or concave. The function accounts for holes. * @param point Input point * @param polygon Input polygon or multipolygon * @returns true if the Point is inside the Polygon; false if the Point is not inside the Polygon From e088fd2475fcda1072bbe16c54755bc6138b41bd Mon Sep 17 00:00:00 2001 From: Tim Haase Date: Mon, 30 Nov 2015 21:48:04 +0100 Subject: [PATCH 033/134] Fix module export in state-machine typing --- state-machine/state-machine.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/state-machine/state-machine.d.ts b/state-machine/state-machine.d.ts index 67f7012b1..d17c58dc6 100644 --- a/state-machine/state-machine.d.ts +++ b/state-machine/state-machine.d.ts @@ -79,5 +79,5 @@ interface StateMachine { declare var StateMachine: StateMachineStatic; declare module "state-machine" { - export = StateMachineStatic; + export = StateMachine; } From 8888d55a20ff2c5db1a575a98196f3e926898808 Mon Sep 17 00:00:00 2001 From: gcroteau Date: Tue, 1 Dec 2015 10:04:25 -0500 Subject: [PATCH 034/134] Renamed turf/turf-test.ts to turf/turf-tests.ts --- turf/{turf-test.ts => turf-tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename turf/{turf-test.ts => turf-tests.ts} (100%) diff --git a/turf/turf-test.ts b/turf/turf-tests.ts similarity index 100% rename from turf/turf-test.ts rename to turf/turf-tests.ts From 93297476d1c3581d58f6cae25c54c14b1133b9fe Mon Sep 17 00:00:00 2001 From: Nick Malaguti Date: Mon, 30 Nov 2015 17:38:57 -0500 Subject: [PATCH 035/134] Add definitions for webdriverio --- webdriverio/webdriverio-tests.ts | 128 ++++ webdriverio/webdriverio.d.ts | 1064 ++++++++++++++++++++++++++++++ 2 files changed, 1192 insertions(+) create mode 100644 webdriverio/webdriverio-tests.ts create mode 100644 webdriverio/webdriverio.d.ts diff --git a/webdriverio/webdriverio-tests.ts b/webdriverio/webdriverio-tests.ts new file mode 100644 index 000000000..205a2c6a6 --- /dev/null +++ b/webdriverio/webdriverio-tests.ts @@ -0,0 +1,128 @@ +/// +/// +/// + +import {assert} from "chai"; + +describe("webdriver.io page", function() { + + it("should have the right title - the good old callback way", function(done) { + + browser + .url("/") + .getTitle(function(err, title) { + assert.equal(err, undefined); + assert.equal(title, "WebdriverIO - Selenium 2.0 javascript bindings for nodejs"); + }) + .call(done); + + }); + + it("should have the right title - the promise way", function() { + + return browser + .url("/") + .getTitle().then(function(title) { + assert.equal(title, "WebdriverIO - Selenium 2.0 javascript bindings for nodejs"); + }); + + }); +}); + +import * as webdriverio from "webdriverio"; + +describe("my webdriverio tests", function(){ + + this.timeout(99999999); + var client: webdriverio.Client; + + before(function(done){ + client = webdriverio.remote({ desiredCapabilities: {browserName: "phantomjs"} }); + client.init(done); + }); + + it("Github test",function(done) { + client + .url("https://github.com/") + .getElementSize(".header-logo-wordmark", function(err: any, result: webdriverio.Size) { + assert.equal(undefined, err); + assert.strictEqual(result.height, 26); + assert.strictEqual(result.width, 89); + }) + .getTitle(function(err: any, title: string) { + assert.equal(undefined, err); + assert.strictEqual(title,"GitHub · Where software is built"); + }) + .getCssProperty("a[href='/plans']", "color", function(err: any, result: webdriverio.CssProperty){ + assert.equal(undefined, err); + assert.strictEqual(result.value, "rgba(64,120,192,1)"); + }) + .call(done); + }); + + after(function(done) { + client.end(done); + }); +}); + +var matrix = webdriverio.multiremote({ + browserA: { + desiredCapabilities: { + browserName: "chrome", + chromeOptions: { + args: [ + "use-fake-device-for-media-stream", + "use-fake-ui-for-media-stream", + ] + } + } + }, + browserB: { + desiredCapabilities: { + browserName: "chrome", + chromeOptions: { + args: [ + "use-fake-device-for-media-stream", + "use-fake-ui-for-media-stream", + ] + } + } + } + }); + +var channel = Math.round(Math.random() * 100000000000); + +matrix + .init() + .url("https://apprtc.appspot.com/r/" + channel) + .click("#confirm-join-button") + .pause(5000) + .end(); + +var options = { + desiredCapabilities: { + browserName: "chrome" + } +}; + +webdriverio + .remote(options) + .init() + .url("https://news.ycombinator.com/") + .selectorExecute("//div", function(inputs: HTMLElement[], message: string) { + return inputs.length + " " + message; + }, "divs on the page") + .then(function(res){ + console.log(res); + }) + .end(); + +webdriverio + .remote(options) + .init() + .url("http://www.google.com/") + .waitForVisible("//input[@type='submit']", 5000) + .then(function(visible){ + console.log(visible); //Should return true + }) + .end(); diff --git a/webdriverio/webdriverio.d.ts b/webdriverio/webdriverio.d.ts new file mode 100644 index 000000000..c123c47c8 --- /dev/null +++ b/webdriverio/webdriverio.d.ts @@ -0,0 +1,1064 @@ +// Type definitions for webdriverio 3.3.0 +// Project: http://www.webdriver.io/ +// Definitions by: Nick Malaguti +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare namespace WebdriverIO { + // EventEmitter + export interface Client { + addListener(event: string, listener: Function): Client; + on(event: string, listener: Function): Client; + once(event: string, listener: Function): Client; + removeListener(event: string, listener: Function): Client; + removeAllListeners(event?: string): Client; + setMaxListeners(n: number): Client; + listeners(event: string): Client; + emit(event: string, ...args: any[]): Client; + } + + // Promise + export interface Client { + call(callback: () => any): Client; + finally(callback: () => any): Client; + then

(onFulfilled?: (value: T) => P | Client

, onRejected?: (err: any) => P | Client

): Client

; + catch

(onRejected?: (err: any) => P | Client

): Client

; + inspect(): Q.PromiseState; + } + + // Action + export interface Client { + addValue(selector: string, value: string | number): Client; + addValue

( + selector: string, + value: string | number, + callback: (err: any) => P + ): Client

; + + clearElement(selector: string): Client; + clearElement

( + selector: string, + callback: (err: any) => P + ): Client

; + + click(selector: string): Client; + click

( + selector: string, + callback: (err: any) => P + ): Client

; + + doubleClick(selector: string): Client; + doubleClick

( + selector: string, + callback: (err: any) => P + ): Client

; + + dragAndDrop(sourceElem: string, destinationElem: string): Client; + dragAndDrop

( + sourceElem: string, + destinationElem: string, callback: (err: any) => P + ): Client

; + + leftClick(selector: string): Client; + leftClick

( + selector: string, + callback: (err: any) => P + ): Client

; + + middleClick(selector: string): Client; + middleClick

( + selector: string, + callback: (err: any) => P + ): Client

; + + moveToObject(selector: string): Client; + moveToObject(selector: string, xoffset: number, yoffset: number): Client; + moveToObject

( + selector: string, + callback: (err: any) => P + ): Client

; + moveToObject

( + selector: string, + xoffset: number, + yoffset: number, + callback: (err: any) => P + ): Client

; + + rightClick(selector: string): Client; + rightClick

( + selector: string, + callback: (err: any) => P + ): Client

; + + selectByIndex(selectElem: string, index: number): Client; + selectByIndex

( + selectElem: string, + index: number, + callback: (err: any) => P + ): Client

; + + selectByValue(selectElem: string, value: string): Client; + selectByValue

( + selectElem: string, + value: string, + callback: (err: any) => P + ): Client

; + + selectByVisibleText(selectElem: string, text: string): Client; + selectByVisibleText

( + selectElem: string, + text: string, + callback: (err: any) => P + ): Client

; + + selectorExecute

( + selectors: string | string[], + script: (elements: HTMLElement | HTMLElement[], ...args: any[]) => P, + ...args: any[] + ): Client

; + + selectorExecuteAsync

( + selectors: string | string[], + script: (elements: HTMLElement | HTMLElement[], ...args: any[]) => P, + ...args: any[] + ): Client

; + + setValue(selector: string, values: number | string | Array): Client; + setValue

( + selector: string, + values: number | string | Array, + callback: (err: any) => P + ): Client; + + submitForm(selector: string): Client; + submitForm

( + selector: string, + callback: (err: any) => P + ): Client; + } + + // Appium + export interface Client { + // backgroundApp + // closeApp + // context + // contexts + // deviceKeyEvent + // getAppStrings + // getCurrentDeviceActivity + // getNetworkConnection + // hideDeviceKeyboard + // installAppOnDevice + // isAppInstalledOnDevice + // launchApp + // lock + // openNotifications + // performMultiAction + // performTouchAction + // pullFileFromDevice + // pushFileToDevice + // removeAppFromDevice + // resetApp + // rotate + // setImmediateValueInApp + // setNetworkConnection + // shake + // toggleAirplaneModeOnDevice + // toggleDataOnDevice + // toggleLocationServicesOnDevice + // toggleWiFiOnDevice + } + + export interface Cookie { + name: string; + value: string; + } + + // Cookie + export interface Client { + deleteCookie(name?: string): Client; + deleteCookie

( + callback: (err: any) => P + ): Client

; + deleteCookie

( + name: string, + callback: (err: any) => P + ): Client

; + + getCookie(): Client; + getCookie(name: string): Client; + getCookie

( + callback: (err: any, cookies: Cookie[]) => P + ): Client

; + getCookie

( + name: string, + callback: (err: any, cookie: Cookie) => P + ): Client

; + + setCookie(cookie: Cookie): Client; + setCookie

( + cookie: Cookie, + callback: (err: any) => P + ): Client

; + } + + // Mobile + export interface Client { + // flick + // flickDown + // flickLeft + // flickRight + // flickUp + // getGeoLocation + // getOrientation + // hold + // release + // setGeoLocation + // setOrientation + // touch + } + + export interface CssProperty { + property: string; + value: string; + parsed: ParsedCssProperty; + } + + export interface ParsedCssProperty { + type: string; + string: string; + quote: string; + unit: string; + value: string | number | string[] | number[]; + } + + export interface Size { + width: number; + height: number; + } + + export interface Location { + x: number; + y: number; + } + + // Property + export interface Client { + getAttribute(selector: string, attributeName: string): Client; + getAttribute

( + selector: string, + attributeName: string, + callback: (err: any, attribute: string | string[]) => P + ): Client

; + + getCssProperty(selector: string, cssProperty: string): Client; + getCssProperty

( + selector: string, + cssProperty: string, + callback: (err: any, cssProperty: CssProperty | CssProperty[]) => P + ): Client

; + + getElementSize(selector: string): Client; + getElementSize(selector: string, dimension: string): Client; + getElementSize

( + selector: string, + callback: (err: any, size: Size | Size[]) => P + ): Client

; + getElementSize

( + selector: string, + dimension: string, + callback: (err: any, elementSize: number | number[]) => P + ): Client

; + + getHTML(selector: string, includeSelectorTag?: boolean): Client; + getHTML

( + selector: string, + callback: (err: any, html: string | string[]) => P + ): Client

; + getHTML

( + selector: string, + includeSelectorTag: boolean, + callback: (err: any, html: string | string[]) => P + ): Client

; + + getLocation(selector: string): Client; + getLocation(selector: string, axis: string): Client; + getLocation

( + selector: string, + callback: (err: any, size: Size) => P + ): Client

; + getLocation

( + selector: string, + axis: string, + callback: (err: any, location: number) => P + ): Client

; + + getLocationInView(selector: string): Client; + getLocationInView(selector: string, axis: string): Client; + getLocationInView

( + selector: string, + callback: (err: any, size: Size | Size[]) => P + ): Client

; + getLocationInView

( + selector: string, + axis: string, + callback: (err: any, location: number | number[]) => P + ): Client

; + + getSource(): Client; + getSource

(callback: (err: any, source: string) => P): Client

; + + getTagName(selector: string): Client; + getTagName

( + selector: string, + callback: (err: any, tagName: string | string[]) => P + ): Client

; + + getText(selector: string): Client; + getText

( + selector: string, + callback: (err: any, text: string | string[]) => P + ): Client

; + + getTitle(): Client; + getTitle

( + callback: (err: any, title: string) => P + ): Client

; + + getUrl(): Client; + getUrl

( + callback: (err: any, title: string) => P + ): Client

; + + getValue(selector: string): Client; + getValue

( + selector: string, + callback: (err: any, value: string | string[]) => P + ): Client

; + } + + export interface LogEntry { + timestamp: number; + level: string; + message: string; + } + + export enum ApplicationCacheStatus { + UNCACHED = 0, + IDLE = 1, + CHECKING = 2, + DOWNLOADING = 3, + UPDATE_READY = 4, + OBSOLETE = 5 + } + + export enum Button { + left = 0, + middle = 1, + right = 2 + } + + export interface StorageItem { + key: string; + value: any; + } + + export interface Location { + latitude: number; + longitude: number; + altitude: number; + } + + export interface Session { + id: string; + capabilities: any; + } + + export interface RawResult { + value: T; + } + + // Navigation + export interface Client { + back(): Client; + back

( + callback: (err: any) => P + ): Client

; + + forward(): Client; + forward

( + callback: (err: any) => P + ): Client

; + + refresh(): Client; + refresh

( + callback: (err: any) => P + ): Client

; + + url(): Client>; + url(url: string): Client; + url

( + callback: (err: any, result: RawResult) => P + ): Client

; + url

( + url: string, + callback: (err: any) => P + ): Client

; + } + + // Advanced input + export interface Client { + // you probably want to use the click and drag and drop commands instead + buttonDown(button?: string | Button): Client; + buttonDown

( + callback: (err: any) => P + ): Client

; + buttonDown

( + button: string | Button, + callback: (err: any) => P + ): Client

; + + // you probably want to use the click and drag and drop commands instead + buttonPress(button?: string | Button): Client; + buttonPress

( + callback: (err: any) => P + ): Client

; + buttonPress

( + button: string | Button, + callback: (err: any) => P + ): Client

; + + // you probably want to use the click and drag and drop commands instead + buttonUp(button?: string | Button): Client; + buttonUp

( + callback: (err: any) => P + ): Client

; + buttonUp(button?: string | Button): Client; + buttonUp

( + button: string | Button, + callback: (err: any) => P + ): Client

; + + // you probably want to use the click and drag and drop commands instead + doDoubleClick(): Client; + doDoubleClick

( + callback: (err: any) => P + ): Client

; + + // you probably want to use addValue and setValue instead + keys(value: string | string[]): Client; + keys

( + value: string | string[], + callback: (err: any) => P + ): Client

; + + // you probably want to use the moveToObject command instead + moveTo(id: ElementId, xoffset?: number, yoffset?: number): Client; + moveTo(xoffset?: number, yoffset?: number): Client; + moveTo

( + id: ElementId, + callback: (err: any) => P + ): Client

; + moveTo

( + id: ElementId, + xoffset: number, + callback: (err: any) => P + ): Client

; + moveTo

( + id: ElementId, + xoffset: number, + yoffset: number, + callback: (err: any) => P + ): Client

; + + // touchClick + // touchDoubleClick + // touchDown + // touchFlick + // touchLongClick + // touchMove + // touchScroll + // touchUp + } + + // Useful Protocol + export interface Client { + alertAccept(): Client; + alertAccept

( + callback: (err: any) => P + ): Client

; + + alertDismiss(): Client; + alertDismiss

( + callback: (err: any) => P + ): Client

; + + alertText(text?: string): Client; + alertText

( + callback: (err: any, text: string) => P + ): Client

; + alertText

( + text: string, + callback: (err: any, text: string) => P + ): Client

; + + frame(id: any): Client; + frame

( + id: any, + callback: (err: any) => P + ): Client

; + + frameParent(): Client; + frameParent

( + callback: (err: any) => P + ): Client

; + + init(capabilities?: DesiredCapabilities): Client; + init

( + callback: (err: any) => P + ): Client

; + init

( + capabilities: DesiredCapabilities, + callback: (err: any) => P + ): Client

; + + log(type: string): Client>; + log

( + type: string, + callback: (err: any, result: RawResult) => P + ): Client

; + + logTypes(): Client>; + logTypes

( + callback: (err: any, result: RawResult) => P + ): Client

; + + session(action?: string, sessionId?: string): Client>; + session

( + callback: (err: any, result: RawResult) => P + ): Client

; + session

( + action: string, + callback: (err: any, result: RawResult) => P + ): Client

; + session

( + action: string, + sessionId: string, + callback: (err: any, result: RawResult) => P + ): Client

; + + sessions(): Client>; + sessions

( + callback: (err: any, sessions: RawResult) => P + ): Client

; + + // timeouts + // timeoutsAsyncScript + // timeoutsImplicitWait + + // window + // windowHandle + // windowHandleMaximize + // windowHandlePosition + // windowHandleSize + // windowHandles + } + + export type ElementId = string; + + export interface Element { + ELEMENT: ElementId; + } + + // Element + export interface Client { + element(selector: string): Client>; + element

( + selector: string, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementActive(): Client>; + elementActive

( + callback: (err: any, element: Element) => P + ): Client

; + + elementIdAttribute(id: ElementId, attributeName: string): Client>; + elementIdAttribute

( + id: ElementId, + attributeName: string, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementIdClear(id: ElementId): Client; + elementIdClear

( + id: ElementId, + callback: (err: any) => P + ): Client

; + + elementIdClick(id: ElementId): Client; + elementIdClick

( + id: ElementId, + callback: (err: any) => P + ): Client

; + + elementIdCssProperty(id: ElementId, propertyName: string): Client>; + elementIdCssProperty

( + id: ElementId, + propertyName: string, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementIdDisplayed(id: ElementId): Client>; + elementIdDisplayed

( + id: ElementId, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementIdElement(id: ElementId, selector: string): Client>; + elementIdElement

( + id: ElementId, + selector: string, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementIdElements(id: ElementId, selector: string): Client>; + elementIdElements

( + id: ElementId, + selector: string, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementIdEnabled(id: ElementId): Client>; + elementIdEnabled

( + id: ElementId, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementIdLocation(id: ElementId): Client>; + elementIdLocation

( + id: ElementId, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementIdLocationInView(id: ElementId): Client>; + elementIdLocationInView

( + id: ElementId, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementIdName(id: ElementId): Client>; + elementIdName

( + id: ElementId, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementIdSelected(id: ElementId): Client>; + elementIdSelected

( + id: ElementId, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementIdSize(id: ElementId): Client>; + elementIdSize

( + id: ElementId, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementIdText(id: ElementId): Client>; + elementIdText

( + id: ElementId, + callback: (err: any, result: RawResult) => P + ): Client

; + + elementIdValue(id: ElementId, values: string | string[]): Client>; + elementIdValue

( + id: ElementId, + values: string | string[], + callback: (err: any, result: RawResult) => P + ): Client

; + + elements(selector: string): Client>; + elements

( + selector: string, + callback: (err: any, result: RawResult) => P + ): Client

; + } + + // Unuseful Protocol + export interface Client { + // applicationCacheStatus + // cookie + + // use selectorExecute instead + execute(script: string | Function, ...args: any[]): Client>; + + // use selectorExecuteAsync instead + executeAsync(script: string | Function, ...args: any[]): Client>; + + // file + // imeActivate + // imeActivated + // imeActiveEngine + // imeAvailableEngines + // imeDeactivated + // localStorage + // localStorageSize + // location + // orientation + // screenshot + // sessionStorage + // sessionStorageSize + // source + // status + + // use submitForm instead + submit(id: ElementId): Client; + submit

( + id: ElementId, + callback: (err: any) => P + ): Client

; + + // title + } + + // State + export interface Client { + isEnabled(selector: string): Client; + isEnabled

( + selector: string, + callback: (err: any, isEnabled: boolean) => P + ): Client

; + + isExisting(selector: string): Client; + isExisting

( + selector: string, + callback: (err: any, isExisting: boolean) => P + ): Client

; + + isSelected(selector: string): Client; + isSelected

( + selector: string, + callback: (err: any, isSelected: boolean) => P + ): Client

; + + isVisible(selector: string): Client; + isVisible

( + selector: string, + callback: (err: any, isVisible: boolean) => P + ): Client

; + + isVisibleWithinViewport(selector: string): Client; + isVisibleWithinViewport

( + selector: string, + callback: (err: any, isVisible: boolean) => P + ): Client

; + } + + export interface CommandHistoryEntry { + command: string; + args: any[]; + } + + // Utility + export interface Client { + addCommand(commandName: string, customMethod: Function, overwrite?: boolean): Client; + addCommand

( + commandName: string, + customMethod: Function, + callback: (err: any) => P + ): Client

; + addCommand

( + commandName: string, + customMethod: Function, + overwrite: boolean, + callback: (err: any) => P + ): Client

; + + chooseFile(selector: string, localPath: string): Client; + chooseFile

( + selector: string, + localPath: string, + callback: (err: any) => P + ): Client

; + + debug(): Client; + debug

( + callback: (err: any) => P + ): Client

; + + end(): Client; + end

( + callback: (err: any) => P + ): Client

; + + endAll(): Client; + endAll

( + callback: (err: any) => P + ): Client

; + + getCommandHistory(): Client; + getCommandHistory

( + callback: (err: any, history: CommandHistoryEntry[]) => P + ): Client

; + + pause(milliseconds: number): Client; + pause

(milliseconds: number, callback: (err: any) => P): Client

; + + saveScreenshot(filename?: string): Client; + saveScreenshot

( + callback: (err: any, screenshot: Buffer) => P + ): Client

; + saveScreenshot

( + filename: string, + callback: (err: any, screenshot: Buffer) => P + ): Client

; + + scroll(selector: string): Client; + scroll(selector: string, xoffset: number, yoffset: number): Client; + scroll(xoffset: number, yoffset: number): Client; + scroll

( + selector: string, + callback: (err: any) => P + ): Client

; + scroll

( + selector: string, + xoffset: number, + yoffset: number, + callback: (err: any) => P + ): Client

; + scroll

( + xoffset: number, + yoffset: number, + callback: (err: any) => P + ): Client

; + + uploadFile(localPath: string): Client; + uploadFile

( + localPath: string, + callback: (err: any) => P + ): Client

; + + waitForEnabled(selector: string, milliseconds?: number, reverse?: boolean): Client; + waitForEnabled

( + selector: string, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitForEnabled

( + selector: string, + milliseconds: number, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitForEnabled

( + selector: string, + milliseconds: number, + reverse: boolean, + callback: (err: any, enabled: boolean) => P + ): Client

; + + waitForExist(selector: string, milliseconds?: number, reverse?: boolean): Client; + waitForExist

( + selector: string, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitForExist

( + selector: string, + milliseconds: number, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitForExist

( + selector: string, + milliseconds: number, + reverse: boolean, + callback: (err: any, enabled: boolean) => P + ): Client

; + + waitForSelected(selector: string, milliseconds?: number, reverse?: boolean): Client; + waitForSelected

( + selector: string, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitForSelected

( + selector: string, + milliseconds: number, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitForSelected

( + selector: string, + milliseconds: number, + reverse: boolean, + callback: (err: any, enabled: boolean) => P + ): Client

; + + waitForText(selector: string, milliseconds?: number, reverse?: boolean): Client; + waitForText

( + selector: string, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitForText

( + selector: string, + milliseconds: number, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitForText

( + selector: string, + milliseconds: number, + reverse: boolean, + callback: (err: any, enabled: boolean) => P + ): Client

; + + waitForValue(selector: string, milliseconds?: number, reverse?: boolean): Client; + waitForValue

( + selector: string, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitForValue

( + selector: string, + milliseconds: number, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitForValue

( + selector: string, + milliseconds: number, + reverse: boolean, + callback: (err: any, enabled: boolean) => P + ): Client

; + + waitForVisible(selector: string, milliseconds?: number, reverse?: boolean): Client; + waitForVisible

( + selector: string, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitForVisible

( + selector: string, + milliseconds: number, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitForVisible

( + selector: string, + milliseconds: number, + reverse: boolean, + callback: (err: any, enabled: boolean) => P + ): Client

; + + waitUntil( + condition: () => boolean | Q.IPromise, + timeout?: number, + interval?: number + ): Client; + waitUntil

( + condition: () => boolean | Q.IPromise, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitUntil

( + condition: () => boolean | Q.IPromise, + timeout: number, + callback: (err: any, enabled: boolean) => P + ): Client

; + waitUntil

( + condition: () => boolean | Q.IPromise, + timeout: number, + interval: number, + callback: (err: any, enabled: boolean) => P + ): Client

; + } + + // Window + export interface Client { + close(windowHandle?: string): Client; + close

( + callback: (err: any) => P + ): Client

; + close

( + windowHandle: string, + callback: (err: any) => P + ): Client

; + + getCurrentTabId(): Client; + getCurrentTabId

( + callback: (err: any, tabId: string) => P + ): Client

; + + getTabIds(): Client; + getTabIds

( + callback: (err: any, tabIds: string[]) => P + ): Client

; + + getViewportSize(): Client; + getViewportSize(dimension: string): Client; + getViewportSize

( + callback: (err: any, size: Size) => P + ): Client

; + getViewportSize

( + dimension: string, + callback: (err: any, viewportSize: number) => P + ): Client

; + + newWindow(url: string, windowName: string, windowFeatures: string): Client; + newWindow

( + url: string, + windowName: string, + windowFeatures: string, + callback: (err: any, windowId: string) => P + ): Client

; + + setViewportSize(size: Size, type: boolean): Client; + setViewportSize

( + size: Size, + type: boolean, + callback: (err: any) => P + ): Client

; + + switchTab(windowHandle?: string): Client; + switchTab

( + callback: (err: any) => P + ): Client

; + switchTab

( + windowHandle: string, + callback: (err: any) => P + ): Client

; + } + + export interface Options { + protocol: string; + waitforTimeout: number; + coloredLogs: boolean; + logLevel: string; + baseUrl: string; + desiredCapabilities: DesiredCapabilities; + screenshotPath: string; + } + + // Options + export interface Client { + options: Options; + } + + export type DesiredCapabilities = any; + + export interface RemoteOptions { + protocol?: string; + waitforTimeout?: number; + waitforInterval?: number; + coloredLogs?: boolean; + logLevel?: string; + baseUrl?: string; + desiredCapabilities?: DesiredCapabilities; + } + + export interface MultiremoteOptions { + [key: string]: RemoteOptions; + } + + export function remote(options?: RemoteOptions | string): Client; + + export function multiremote(options?: MultiremoteOptions): Client; +} + +declare var browser: WebdriverIO.Client; + +declare module "webdriverio" { + export = WebdriverIO; +} From a9d32277887e04382960651d1a90ac02a335cee6 Mon Sep 17 00:00:00 2001 From: olemp Date: Tue, 1 Dec 2015 17:26:14 +0100 Subject: [PATCH 036/134] Added function declarations for ExecuteOrDelayUntilBodyLoaded, ExecuteOrDelayUntilScriptLoaded and ExecuteOrDelayUntilEventNotified. --- sharepoint/SharePoint.d.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sharepoint/SharePoint.d.ts b/sharepoint/SharePoint.d.ts index c62b68b16..4e32dade4 100644 --- a/sharepoint/SharePoint.d.ts +++ b/sharepoint/SharePoint.d.ts @@ -1,12 +1,15 @@ -// Type definitions for SharePoint 2010 and 2013 -// Project: https://github.com/gandjustas/sptypescript -// Definitions by: Stanislav Vyshchepan , Andrey Markeev -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// +// Type definitions for SharePoint 2010 and 2013 +// Project: https://github.com/gandjustas/sptypescript +// Definitions by: Stanislav Vyshchepan , Andrey Markeev +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// declare var _spBodyOnLoadFunctions: Function[]; declare var _spBodyOnLoadFunctionNames: string[]; declare var _spBodyOnLoadCalled: boolean; +declare function ExecuteOrDelayUntilBodyLoaded(initFunc: () => void): void; +declare function ExecuteOrDelayUntilScriptLoaded(func: () => void, depScriptFileName: string): boolean; +declare function ExecuteOrDelayUntilEventNotified(func: Function, eventName: string): boolean; declare var Strings:any; declare module SP { From 025706049a03269ff69b82b77321d1b7e0d24804 Mon Sep 17 00:00:00 2001 From: Lars Michaelis Date: Wed, 2 Dec 2015 11:19:26 +0100 Subject: [PATCH 037/134] Initial commit --- jsf/jsf-tests.ts | 3 ++ jsf/jsf.d.ts | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 jsf/jsf-tests.ts create mode 100644 jsf/jsf.d.ts diff --git a/jsf/jsf-tests.ts b/jsf/jsf-tests.ts new file mode 100644 index 000000000..c944bc72d --- /dev/null +++ b/jsf/jsf-tests.ts @@ -0,0 +1,3 @@ +/// + +import jsf = require("jsf"); diff --git a/jsf/jsf.d.ts b/jsf/jsf.d.ts new file mode 100644 index 000000000..14f7b407d --- /dev/null +++ b/jsf/jsf.d.ts @@ -0,0 +1,72 @@ +// Type definitions for for the JSF 2.0 Ajax request API. +// Project: https://docs.oracle.com/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/js-api/symbols/jsf.ajax.html +// Definitions by: Lars Michaelis and Stephan Zerhusen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "jsf" { + module ajax { + + interface RequestData { + status: string; + description: string; + } + + interface RequestOptions { + /** + * space seperated list of client identifiers + */ + execute?: String; + + /** + * space seperated list of client identifiers + */ + render?: String; + + /** + * function to callback for event + * @param callback the callback function + */ + onevent?(callback:(data:RequestData) => void): void; + + /** + * function to callback for error + * @param callback the callback function + */ + onerror?(callback:(data:RequestData) => void): void; + + /** + * object containing parameters to include in the request + */ + params?: any; + } + + /** + * Register a callback for event handling. + * @param callback a reference to a function to call on an event + */ + function addOnEvent(callback:(data:RequestData) => void):void; + + /** + * Register a callback for error handling. + * @param callback a reference to a function to call on an error + */ + function addOnError(callback:(data:RequestData) => void):void; + + /** + * Send an asynchronous Ajax request to the server. + * @param source The DOM element that triggered this Ajax request, or an id string of the element to use as the triggering element. + * @param event The DOM event that triggered this Ajax request. The event argument is optional. + * @param options The set of available options that can be sent as request parameters to control client and/or server side request processing. + */ + function request(source:any, event?:String, options?:RequestOptions):void; + + /** + * Receive an Ajax response from the server. + * @param request The XMLHttpRequest instance that contains the status code and response message from the server. + * @param context An object containing the request context, including the following properties: the source element, per call onerror callback function, and per call onevent callback function. + * @throws EmptyResponse error if request contains no data + */ + function response(request:any, context:any):void; + + } +} From 56b3481c312ea9318b10b7f26df2b269c247c92d Mon Sep 17 00:00:00 2001 From: Lars Michaelis Date: Wed, 2 Dec 2015 11:30:10 +0100 Subject: [PATCH 038/134] make it compile with npm test --- jsf/jsf-tests.ts | 1 - jsf/jsf.d.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/jsf/jsf-tests.ts b/jsf/jsf-tests.ts index c944bc72d..b56749a4a 100644 --- a/jsf/jsf-tests.ts +++ b/jsf/jsf-tests.ts @@ -1,3 +1,2 @@ /// -import jsf = require("jsf"); diff --git a/jsf/jsf.d.ts b/jsf/jsf.d.ts index 14f7b407d..9c7f6a43d 100644 --- a/jsf/jsf.d.ts +++ b/jsf/jsf.d.ts @@ -1,6 +1,6 @@ -// Type definitions for for the JSF 2.0 Ajax request API. +// Type definitions for for the JSF 2.0 Ajax request API // Project: https://docs.oracle.com/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/js-api/symbols/jsf.ajax.html -// Definitions by: Lars Michaelis and Stephan Zerhusen +// Definitions by: Lars Michaelis and Stephan Zerhusen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "jsf" { From 2c123744f00cb74676333a45e1ef4f0750b3b39f Mon Sep 17 00:00:00 2001 From: Lars Michaelis Date: Wed, 2 Dec 2015 11:46:17 +0100 Subject: [PATCH 039/134] add tests --- jsf/jsf-tests.ts | 25 +++++++++++++++++++++++++ jsf/jsf.d.ts | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/jsf/jsf-tests.ts b/jsf/jsf-tests.ts index b56749a4a..3c594f1e5 100644 --- a/jsf/jsf-tests.ts +++ b/jsf/jsf-tests.ts @@ -1,2 +1,27 @@ /// +function callbackWithoutData() { + +} + +function callback(data: jsf.ajax.RequestData) { + +} + +class RequestOptionsImpl implements jsf.ajax.RequestOptions { + execute = "@all"; + render = "@none"; +} + + +jsf.ajax.addOnEvent(callbackWithoutData); +jsf.ajax.addOnEvent(callback); + +jsf.ajax.addOnError(callbackWithoutData); +jsf.ajax.addOnError(callback); + +jsf.ajax.request("someSource"); +jsf.ajax.request("someSource", "change"); +jsf.ajax.request("someSource", "change", new RequestOptionsImpl()); + +jsf.ajax.response("someRequestObject", "someContextObject"); diff --git a/jsf/jsf.d.ts b/jsf/jsf.d.ts index 9c7f6a43d..d19dafe0e 100644 --- a/jsf/jsf.d.ts +++ b/jsf/jsf.d.ts @@ -3,7 +3,7 @@ // Definitions by: Lars Michaelis and Stephan Zerhusen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "jsf" { +declare module jsf { module ajax { interface RequestData { From 722e48a621b68c5acae43f51373bd799731dfb74 Mon Sep 17 00:00:00 2001 From: Lars Michaelis Date: Wed, 2 Dec 2015 11:49:37 +0100 Subject: [PATCH 040/134] add tests --- jsf/jsf-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jsf/jsf-tests.ts b/jsf/jsf-tests.ts index 3c594f1e5..76815bf9e 100644 --- a/jsf/jsf-tests.ts +++ b/jsf/jsf-tests.ts @@ -4,13 +4,13 @@ function callbackWithoutData() { } -function callback(data: jsf.ajax.RequestData) { +function callback(data:jsf.ajax.RequestData) { } class RequestOptionsImpl implements jsf.ajax.RequestOptions { execute = "@all"; - render = "@none"; + render = "@none"; } @@ -24,4 +24,4 @@ jsf.ajax.request("someSource"); jsf.ajax.request("someSource", "change"); jsf.ajax.request("someSource", "change", new RequestOptionsImpl()); -jsf.ajax.response("someRequestObject", "someContextObject"); +jsf.ajax.response("someRequestObject", {context: "someContextObject"}); From 0ab253f326e45430cbad0e2182b080a13cfd0b60 Mon Sep 17 00:00:00 2001 From: Long Yinan Date: Thu, 3 Dec 2015 14:45:42 +0800 Subject: [PATCH 041/134] fix(angularjs): add toJSON method --- angularjs/angular-resource-tests.ts | 5 +++++ angularjs/angular-resource.d.ts | 3 +++ 2 files changed, 8 insertions(+) diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts index cfa7712cc..fcf0bd0a9 100644 --- a/angularjs/angular-resource-tests.ts +++ b/angularjs/angular-resource-tests.ts @@ -89,6 +89,9 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { var promise : angular.IPromise; var arrayPromise : angular.IPromise; +var json: { + [index: string]: any; +}; promise = resource.$delete(); promise = resource.$delete({ key: 'value' }); @@ -127,6 +130,8 @@ promise = resource.$save(function () { }); promise = resource.$save(function () { }, function () { }); promise = resource.$save({ key: 'value' }, function () { }, function () { }); +json = resource.toJSON(); + /////////////////////////////////////// // IResourceService /////////////////////////////////////// diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 76930196b..2187130ac 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -136,6 +136,9 @@ declare module angular.resource { /** the promise of the original server interaction that created this instance. **/ $promise : angular.IPromise; $resolved : boolean; + toJSON: () => { + [index: string]: any; + } } /** From 288805ab6ecdd11305d39168abaaeba9e4924650 Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Thu, 3 Dec 2015 08:28:19 +0100 Subject: [PATCH 042/134] added type defs for foundation-sites 6.0.4 --- foundation-sites/foundation.d.ts | 426 +++++++++++++++++++++++++++++++ 1 file changed, 426 insertions(+) create mode 100644 foundation-sites/foundation.d.ts diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts new file mode 100644 index 000000000..c72a93ba1 --- /dev/null +++ b/foundation-sites/foundation.d.ts @@ -0,0 +1,426 @@ +// Type definitions for Foundation Sites v6.0.4 +// Project: http://foundation.zurb.com/ +// Definitions by: Sam Vloeberghs +// Definitions by: Michał Wrześniewski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Foundation { + + // http://foundation.zurb.com/sites/docs/abide.html#javascript-reference + export interface Abide { + requiredCheck: (element:Object) => boolean; + findLabel: (element:Object) => boolean; + addErrorClasses: (element:Object) => void; + removeErrorClasses: (element:Object) => void; + validateInput: (element:Object, form:Object) => void; + validateForm: (element:Object) => void; + validateText: (element:Object) => boolean; + validateRadio: (group:String) => boolean; + resetform: ($form:Object) => void; + } + + interface IAbidePaterns { + alpha?: RegExp; + alpha_numeric?: RegExp; + integer?: RegExp; + number?: RegExp; + card?: RegExp; + cvv?: RegExp; + email ?: RegExp; + url?: RegExp; + domain?: RegExp; + datetime?: RegExp; + date?: RegExp; + time?: RegExp; + dateISO?: RegExp; + month_day_year?: RegExp; + day_month_year?: RegExp; + color?: RegExp; + } + + interface IAbideOptions { + slideSpeed?: number + multiOpen?: boolean; + } + + // http://foundation.zurb.com/sites/docs/accordion.html#javascript-reference + export interface Accordion { + toggle: ($target:JQuery) => void; + down: ($target:JQuery, firstTime:boolean) => void; + up: ($target:JQuery) => void; + destroy: () => void; + } + + interface IAccordionOptions { + slideSpeed?: number + multiOpen?: boolean; + } + + // http://foundation.zurb.com/sites/docs/accordion-menu.html#javascript-reference + export interface AccordionMenu { + toggle: ($target:JQuery) => void; + down: ($target:JQuery, firstTime:boolean) => void; + up: ($target:JQuery) => void; + destroy: () => void; + } + + // http://foundation.zurb.com/sites/docs/drilldown-menu.html#javascript-reference + export interface Drilldown { + _hideAll: ($elem:JQuery) => void; + _show: ($elem:JQuery) => void; + _hide: ($elem:JQuery) => void; + destroy: () => void; + } + + interface IDrilldownOptions { + backButton?: String; + wrapper?: String + closeOnClick?: boolean + } + + // http://foundation.zurb.com/sites/docs/dropdown.html#javascript-reference + export interface Dropdown { + getPositionClass: () => String; + open: () => void; + close: () => void; + toggle: () => void; + destroy: () => void; + } + + interface IDropdownOptions { + hoverDelay?: number; + hover?: boolean; + vOffset?: number; + hOffset?: number; + positionClass?: String; + trapFocus?: boolean; + autoFocus?: boolean; + } + + // http://foundation.zurb.com/sites/docs/dropdown-menu.html#javascript-reference + export interface DropdownMenu { + destroy: () => void; + } + + interface IDropdownMenuOptions { + disableHover?: boolean; + autoclose?: boolean; + hoverDelay?: number; + clickOpen?: boolean; + closingTime?: number; + alignments?: String; + verticalClasss?: String; + rightClasss?: String; + } + + // http://foundation.zurb.com/sites/docs/equalizer.html#javascript-reference + export interface Equalizer { + getHeights: (element:Object) => Array; + applyHeight: ($eqParent:Object, heights:Array) => void; + destroy: () => void; + } + + interface IEqualizerOptions { + equalizeOnStack?: boolean; + throttleInterval?: number; + } + + // http://foundation.zurb.com/sites/docs/interchange.html#javascript-reference + export interface Interchange { + replace: (path:String) => void; + destroy: () => void; + } + + interface IInterchangeOptions { + rules?: Array + } + + // http://foundation.zurb.com/sites/docs/magellan.html#javascript-reference + export interface Magellan { + calcPoints: () => void; + reflow: () => void; + destroy: () => void; + } + + interface IMagellanOptions { + animationDuration?: number; + animationEasing?: String; + threshold?: number; + activeClass?: String; + deepLinking?: boolean; + } + + // http://foundation.zurb.com/sites/docs/offcanvas.html#javascript-reference + export interface OffCanvas { + open: (event:Object, trigger:JQuery) => void; + toggle: (event:Object, trigger:JQuery) => void; + close: () => void; + destroy: () => void; + } + + interface IOffCanvasOptions { + closeOnClick?: boolean; + transitionTime?: number; + position?: String; + forceTop?: boolean; + isRevealed?: boolean; + revealOn?: String; + autoFocus?: boolean; + revealClass?: String; + } + + // http://foundation.zurb.com/sites/docs/orbit.html#javascript-reference + export interface Orbit { + changeSlide: (isLTR:boolean, chosenSlide?:Object, idx?:number) => void; + geoSync: () => void; + destroy: () => void; + } + + interface IOrbitOptions { + bullets?: boolean; + navButtons?: boolean; + animInFromRight?: String; + animOutToRight?: String; + animInFromLeft?: String; + animOutToLeft?: String; + autoPlay?: boolean; + timerDelay?: number; + infiniteWrap?: boolean; + swipe?: boolean; + pauseOnHover?: boolean; + accessible?: boolean; + containerClass?: String; + slideClass?: String; + boxOfBullets?: String; + nextClass?: String; + prevClass?: String; + } + + // http://foundation.zurb.com/sites/docs/reveal.html#javascript-reference + export interface Reveal { + open: () => void; + toggle: () => void; + close: () => void; + destroy: () => void; + } + + interface IRevealOptions { + animationIn?: String; + animationOut?: String; + showDelay?: number; + hideDelay?: number; + closeOnClick?: boolean; + closeOnEsc?: boolean; + multipleOpened?: boolean; + vOffset?: number; + hOffset?: number; + fullScreen?: boolean; + btmOffsetPct?: number; + overlay?: boolean; + resetOnClose?: boolean; + } + + // http://foundation.zurb.com/sites/docs/slider.html#javascript-reference + export interface Slider { + destroy: () => void; + } + + interface ISliderOptions { + start?: number; + end?: number; + step?: number; + initialStart ?: number; + initialEnd?: number; + binding?: boolean; + clickSelect?: boolean; + vertical?: boolean; + draggable?: boolean; + disabled?: boolean; + doubleSided?: boolean; + decimal?: number; + moveTime?: number; + disabledClass?: String; + } + + // http://foundation.zurb.com/sites/docs/sticky.html#javascript-reference + export interface Sticky { + _pauseListeners: (scrollListener:String) => void; + _calc: (checkSizes:boolean, scroll:number) => void; + destroy: () => void; + emCalc: (number:any) => void; + } + + interface IStickyOptions { + container?: String; + stickTo?: String; + anchor?: String; + topAnchor?: String; + btmAnchor?: String; + marginTop?: number; + marginBottom?: number; + stickyOn?: String; + stickyClass?: String; + containerClass?: String; + checkEvery?: number; + } + + // http://foundation.zurb.com/sites/docs/tabs.html#javascript-reference + export interface Tabs { + _handleTabChange: ($target:JQuery) => void; + selectTab: ($target:JQuery) => void; + destroy: () => void; + } + + interface ITabsOptions { + animate?: boolean; + } + + // http://foundation.zurb.com/sites/docs/toggler.html#javascript-reference + export interface Toggler { + toggle: () => void; + destroy: () => void; + } + + interface ITogglerOptions { + animate?: boolean; + } + + // http://foundation.zurb.com/sites/docs/tooltip.html#javascript-reference + export interface Tooltip { + show: () => void; + hide: () =>void; + toggle: () => void; + destroy: () => void; + } + + interface ITooltipOptions { + hoverDelay?: number; + fadeInDuration?: number; + fadeOutDuration?: number; + disableHover?: boolean; + templateClasses?: String; + tooltipClass?: String; + triggerClass?: String; + showOn?: String; + template?: String; + tipText?: String; + clickOpen?: boolean; + positionClass?: String; + vOffset?: number; + hOffset?:number; + } + + // Utilities + // --------- + + export interface Box { + ImNotTouchingYou: (element:Object, parent?:Object, lrOnly?:boolean, tbOnly?:boolean) => boolean; + GetDimensions: (element:Object) => Object; + GetOffsets: (element:Object, anchor:Object, position:String, vOffset:number, hOffset:number, isOverflow:boolean) => Object; + } + + export interface KeyBoard { + parseKey: (event:any) => String; + findFocusable: ($element:Object) => Object; + } + + export interface MediaQuery { + get: (size:String) => String; + atLeast: (size:String) => boolean; + queries:Array; + current:any; + } + + export interface Motion { + animateIn: (element:Object, animation:any, cb:Function) => void; + animateOut: (element:Object, animation:any, cb:Function) => void; + } + + interface Move { + // TODO + } + + interface Nest { + // TODO + } + + export interface Timer { + start: () => void; + restart: () => void; + pause: () => void; + } + + interface Touch { + // TODO :extension on jQuery + } + + interface Triggers { + // TODO :extension on jQuery + } + + export interface InterChange { + destroy: () => void; + } + interface IInterChangeOptions { + rules ?: Array; + } + interface ITooltipOptions { + hoverDelay ?: number; + fadeInDuration ?: number; + fadeOutDuration ?: number; + disableHover ?: boolean; + templateClasses ?: String; + tooltipClass ?: String; + triggerClass ?: String; + showOn ?: String; + template ?: String; + tipText ?: String; + clickOpenr ?: boolean; + positionClass ?: String; + vOffset ?: number; + hOffset ?: number; + } + + interface FoundationStatic { + version : String; + + rtl: () => boolean; + plugin: (plugin:Object, name:String) => void; + registerPlugin: (plugin:Object) => void; + unregisterPlugin: (plugin:Object) => void; + GetYoDigits: (length:number, namespace?:String) => String; + reflow: (elem:Object, plugins?:Array|String) => void; + getFnName: (fofn:String) => String; + transitionend: () => String; + + util : { + throttle(func:(...args:any[]) => any, delay:number) : (...args:any[]) => any; + }; + onImagesLoaded: (images:Object, cb:Function) => void; + + Abide: (element:Object, options:IAbideOptions) => void; + Accordion: (element:Object, options:IAccordionOptions) => void; + Dropdown: (element:Object, options:IDropdownOptions) => void; + DropdownMenu: (element:Object, options:IDropdownMenuOptions) => void; + Equalizer: (element:Object, options:IEqualizerOptions) => void; + Interchange: (element:Object, options:IInterChangeOptions) => void; + Magellan: (element:Object, options:IMagellanOptions) => void; + OffCanvas: (element:Object, options:IOffCanvasOptions) => void; + Orbit: (element:Object, options:IOrbitOptions) => void; + Reveal: (element:Object, options:IRevealOptions) => void; + Slider: (element:Object, options:ISliderOptions) => void; + Sticky: (element:Object, options:IStickyOptions) => void; + Tabs: (element:Object, options:ITabsOptions) => void; + Toggler: (element:Object, options:ITogglerOptions) => void; + Tooltip: (element:Object, options:ITooltipOptions) => void; + + } +} + +interface JQuery { + foundation(method:String|Array) : JQuery; +} + +declare var Foundation:Foundation.FoundationStatic; From 6ced381e2f78f050b810e1b2c8387734a35f62eb Mon Sep 17 00:00:00 2001 From: Michal Wrzesniewski Date: Thu, 3 Dec 2015 10:32:56 +0100 Subject: [PATCH 043/134] test file created --- foundation-sites/foundation-tests.ts | 2 ++ foundation-sites/foundation.d.ts | 25 +++++-------------------- 2 files changed, 7 insertions(+), 20 deletions(-) create mode 100644 foundation-sites/foundation-tests.ts diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts new file mode 100644 index 000000000..7aab47e80 --- /dev/null +++ b/foundation-sites/foundation-tests.ts @@ -0,0 +1,2 @@ +/// +/// \ No newline at end of file diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts index c72a93ba1..1093a954a 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation.d.ts @@ -344,6 +344,8 @@ declare module Foundation { interface Nest { // TODO + //Feather: function(menu, type) + // Burn: function(menu, type){ } export interface Timer { @@ -360,29 +362,12 @@ declare module Foundation { // TODO :extension on jQuery } - export interface InterChange { - destroy: () => void; - } + interface IInterChangeOptions { - rules ?: Array; - } - interface ITooltipOptions { - hoverDelay ?: number; - fadeInDuration ?: number; - fadeOutDuration ?: number; - disableHover ?: boolean; - templateClasses ?: String; - tooltipClass ?: String; - triggerClass ?: String; - showOn ?: String; - template ?: String; - tipText ?: String; - clickOpenr ?: boolean; - positionClass ?: String; - vOffset ?: number; - hOffset ?: number; + rules ?: Array; } + interface FoundationStatic { version : String; From 400a0e998dcf4acec0049aa1282010129b792401 Mon Sep 17 00:00:00 2001 From: Michal Wrzesniewski Date: Thu, 3 Dec 2015 10:35:11 +0100 Subject: [PATCH 044/134] test file: Header added --- foundation-sites/foundation-tests.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts index 7aab47e80..e99545d6d 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-tests.ts @@ -1,2 +1,8 @@ +// Tests for type definitions for Foundation Sites v6.0.4 +// Project: http://foundation.zurb.com/ +// Definitions by: Sam Vloeberghs +// Definitions by: Michał Wrześniewski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + /// /// \ No newline at end of file From 281dabc4bef9a2e2219a26c10d567ab3d024891e Mon Sep 17 00:00:00 2001 From: Michal Wrzesniewski Date: Thu, 3 Dec 2015 10:37:50 +0100 Subject: [PATCH 045/134] Equalizer compiler error fixed --- foundation-sites/foundation.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts index 1093a954a..27d761a38 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation.d.ts @@ -118,7 +118,7 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/equalizer.html#javascript-reference export interface Equalizer { getHeights: (element:Object) => Array; - applyHeight: ($eqParent:Object, heights:Array) => void; + applyHeight: ($eqParent:Object, heights:Array) => void; destroy: () => void; } From 9416558e735d2a959b1f752080eae78fd66acedd Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Thu, 3 Dec 2015 10:52:54 +0100 Subject: [PATCH 046/134] update --- foundation-sites/foundation-tests.ts | 9 + foundation-sites/foundation.d.ts | 236 +++++++++++++-------------- foundation/foundation-tests.ts | 1 + 3 files changed, 122 insertions(+), 124 deletions(-) create mode 100644 foundation-sites/foundation-tests.ts diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts new file mode 100644 index 000000000..7238fe047 --- /dev/null +++ b/foundation-sites/foundation-tests.ts @@ -0,0 +1,9 @@ +/// +/// + +$(document).foundation(); +$(document).foundation('method'); +$(document).foundation(['method', 'method2']); + +Foundation.Abide($('.selector')); + diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts index c72a93ba1..afacabb43 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation.d.ts @@ -9,19 +9,19 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/abide.html#javascript-reference - export interface Abide { - requiredCheck: (element:Object) => boolean; - findLabel: (element:Object) => boolean; - addErrorClasses: (element:Object) => void; - removeErrorClasses: (element:Object) => void; - validateInput: (element:Object, form:Object) => void; - validateForm: (element:Object) => void; - validateText: (element:Object) => boolean; - validateRadio: (group:String) => boolean; - resetform: ($form:Object) => void; + interface Abide { + requiredCheck(element:Object): boolean; + findLabel(element:Object): boolean; + addErrorClasses(element:Object): void; + removeErrorClasses(element:Object): void; + validateInput(element:Object, form:Object): void; + validateForm(element:Object): void; + validateText(element:Object): boolean; + validateRadio(group:String): boolean; + resetform($form:Object): void; } - interface IAbidePaterns { + export interface IAbidePatterns { alpha?: RegExp; alpha_numeric?: RegExp; integer?: RegExp; @@ -40,17 +40,17 @@ declare module Foundation { color?: RegExp; } - interface IAbideOptions { + export interface IAbideOptions { slideSpeed?: number multiOpen?: boolean; } // http://foundation.zurb.com/sites/docs/accordion.html#javascript-reference export interface Accordion { - toggle: ($target:JQuery) => void; - down: ($target:JQuery, firstTime:boolean) => void; - up: ($target:JQuery) => void; - destroy: () => void; + toggle($target:JQuery): void; + down($target:JQuery, firstTime:boolean): void; + up($target:JQuery): void; + destroy(): void; } interface IAccordionOptions { @@ -60,18 +60,18 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/accordion-menu.html#javascript-reference export interface AccordionMenu { - toggle: ($target:JQuery) => void; - down: ($target:JQuery, firstTime:boolean) => void; - up: ($target:JQuery) => void; - destroy: () => void; + toggle($target:JQuery): void; + down($target:JQuery, firstTime:boolean): void; + up($target:JQuery): void; + destroy(): void; } // http://foundation.zurb.com/sites/docs/drilldown-menu.html#javascript-reference export interface Drilldown { - _hideAll: ($elem:JQuery) => void; - _show: ($elem:JQuery) => void; - _hide: ($elem:JQuery) => void; - destroy: () => void; + _hideAll($elem:JQuery): void; + _show($elem:JQuery): void; + _hide($elem:JQuery): void; + destroy(): void; } interface IDrilldownOptions { @@ -82,11 +82,11 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/dropdown.html#javascript-reference export interface Dropdown { - getPositionClass: () => String; - open: () => void; - close: () => void; - toggle: () => void; - destroy: () => void; + getPositionClass(): String; + open(): void; + close(): void; + toggle(): void; + destroy(): void; } interface IDropdownOptions { @@ -101,7 +101,7 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/dropdown-menu.html#javascript-reference export interface DropdownMenu { - destroy: () => void; + destroy(): void; } interface IDropdownMenuOptions { @@ -117,9 +117,9 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/equalizer.html#javascript-reference export interface Equalizer { - getHeights: (element:Object) => Array; - applyHeight: ($eqParent:Object, heights:Array) => void; - destroy: () => void; + getHeights(element:Object): Array; + applyHeight($eqParent:Object, heights:Array): void; + destroy(): void; } interface IEqualizerOptions { @@ -129,8 +129,8 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/interchange.html#javascript-reference export interface Interchange { - replace: (path:String) => void; - destroy: () => void; + replace(path:String): void; + destroy(): void; } interface IInterchangeOptions { @@ -139,9 +139,9 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/magellan.html#javascript-reference export interface Magellan { - calcPoints: () => void; - reflow: () => void; - destroy: () => void; + calcPoints(): void; + reflow(): void; + destroy(): void; } interface IMagellanOptions { @@ -154,10 +154,10 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/offcanvas.html#javascript-reference export interface OffCanvas { - open: (event:Object, trigger:JQuery) => void; - toggle: (event:Object, trigger:JQuery) => void; - close: () => void; - destroy: () => void; + open(event:Object, trigger:JQuery): void; + toggle(event:Object, trigger:JQuery): void; + close(): void; + destroy(): void; } interface IOffCanvasOptions { @@ -173,9 +173,9 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/orbit.html#javascript-reference export interface Orbit { - changeSlide: (isLTR:boolean, chosenSlide?:Object, idx?:number) => void; - geoSync: () => void; - destroy: () => void; + changeSlide(isLTR:boolean, chosenSlide?:Object, idx?:number): void; + geoSync(): void; + destroy(): void; } interface IOrbitOptions { @@ -200,10 +200,10 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/reveal.html#javascript-reference export interface Reveal { - open: () => void; - toggle: () => void; - close: () => void; - destroy: () => void; + open(): void; + toggle(): void; + close(): void; + destroy(): void; } interface IRevealOptions { @@ -224,7 +224,7 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/slider.html#javascript-reference export interface Slider { - destroy: () => void; + destroy(): void; } interface ISliderOptions { @@ -246,10 +246,10 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/sticky.html#javascript-reference export interface Sticky { - _pauseListeners: (scrollListener:String) => void; - _calc: (checkSizes:boolean, scroll:number) => void; - destroy: () => void; - emCalc: (number:any) => void; + _pauseListeners(scrollListener:String): void; + _calc(checkSizes:boolean, scroll:number): void; + destroy(): void; + emCalc(number:any): void; } interface IStickyOptions { @@ -268,9 +268,9 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/tabs.html#javascript-reference export interface Tabs { - _handleTabChange: ($target:JQuery) => void; - selectTab: ($target:JQuery) => void; - destroy: () => void; + _handleTabChange($target:JQuery): void; + selectTab($target:JQuery): void; + destroy(): void; } interface ITabsOptions { @@ -279,8 +279,8 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/toggler.html#javascript-reference export interface Toggler { - toggle: () => void; - destroy: () => void; + toggle(): void; + destroy(): void; } interface ITogglerOptions { @@ -289,10 +289,10 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/tooltip.html#javascript-reference export interface Tooltip { - show: () => void; - hide: () =>void; - toggle: () => void; - destroy: () => void; + show(): void; + hide() =>void; + toggle(): void; + destroy(): void; } interface ITooltipOptions { @@ -316,26 +316,26 @@ declare module Foundation { // --------- export interface Box { - ImNotTouchingYou: (element:Object, parent?:Object, lrOnly?:boolean, tbOnly?:boolean) => boolean; - GetDimensions: (element:Object) => Object; - GetOffsets: (element:Object, anchor:Object, position:String, vOffset:number, hOffset:number, isOverflow:boolean) => Object; + ImNotTouchingYou(element:Object, parent?:Object, lrOnly?:boolean, tbOnly?:boolean): boolean; + GetDimensions(element:Object): Object; + GetOffsets(element:Object, anchor:Object, position:String, vOffset:number, hOffset:number, isOverflow:boolean): Object; } export interface KeyBoard { - parseKey: (event:any) => String; - findFocusable: ($element:Object) => Object; + parseKey(event:any): String; + findFocusable($element:Object): Object; } export interface MediaQuery { - get: (size:String) => String; - atLeast: (size:String) => boolean; + get(size:String): String; + atLeast(size:String): boolean; queries:Array; current:any; } export interface Motion { - animateIn: (element:Object, animation:any, cb:Function) => void; - animateOut: (element:Object, animation:any, cb:Function) => void; + animateIn(element:Object, animation:any, cb:Function): void; + animateOut(element:Object, animation:any, cb:Function): void; } interface Move { @@ -347,9 +347,9 @@ declare module Foundation { } export interface Timer { - start: () => void; - restart: () => void; - pause: () => void; + start(): void; + restart(): void; + pause(): void; } interface Touch { @@ -360,67 +360,55 @@ declare module Foundation { // TODO :extension on jQuery } - export interface InterChange { - destroy: () => void; - } - interface IInterChangeOptions { - rules ?: Array; - } - interface ITooltipOptions { - hoverDelay ?: number; - fadeInDuration ?: number; - fadeOutDuration ?: number; - disableHover ?: boolean; - templateClasses ?: String; - tooltipClass ?: String; - triggerClass ?: String; - showOn ?: String; - template ?: String; - tipText ?: String; - clickOpenr ?: boolean; - positionClass ?: String; - vOffset ?: number; - hOffset ?: number; - } - interface FoundationStatic { version : String; - rtl: () => boolean; - plugin: (plugin:Object, name:String) => void; - registerPlugin: (plugin:Object) => void; - unregisterPlugin: (plugin:Object) => void; - GetYoDigits: (length:number, namespace?:String) => String; - reflow: (elem:Object, plugins?:Array|String) => void; - getFnName: (fofn:String) => String; - transitionend: () => String; + rtl(): boolean; + plugin(plugin:Object, name:String): void; + registerPlugin(plugin:Object): void; + unregisterPlugin(plugin:Object): void; + GetYoDigits(length:number, namespace?:String): String; + reflow(elem:Object, plugins?:Array|String): void; + getFnName(fn:String): String; + transitionend(): String; util : { - throttle(func:(...args:any[]) => any, delay:number) : (...args:any[]) => any; + throttle(func:(...args:any[]) => any, delay:number) (...args:any[]) => any; }; - onImagesLoaded: (images:Object, cb:Function) => void; + onImagesLoaded(images:Object, cb:Function): void; - Abide: (element:Object, options:IAbideOptions) => void; - Accordion: (element:Object, options:IAccordionOptions) => void; - Dropdown: (element:Object, options:IDropdownOptions) => void; - DropdownMenu: (element:Object, options:IDropdownMenuOptions) => void; - Equalizer: (element:Object, options:IEqualizerOptions) => void; - Interchange: (element:Object, options:IInterChangeOptions) => void; - Magellan: (element:Object, options:IMagellanOptions) => void; - OffCanvas: (element:Object, options:IOffCanvasOptions) => void; - Orbit: (element:Object, options:IOrbitOptions) => void; - Reveal: (element:Object, options:IRevealOptions) => void; - Slider: (element:Object, options:ISliderOptions) => void; - Sticky: (element:Object, options:IStickyOptions) => void; - Tabs: (element:Object, options:ITabsOptions) => void; - Toggler: (element:Object, options:ITogglerOptions) => void; - Tooltip: (element:Object, options:ITooltipOptions) => void; + Abide(element:Object, options?:IAbideOptions): Foundation.Abide; + Accordion(element:Object, options?:IAccordionOptions): Foundation.Accordion; + Dropdown(element:Object, options?:IDropdownOptions): Foundation.Dropdown; + DropdownMenu(element:Object, options?:IDropdownMenuOptions): Foundation.DropdownMenu; + Equalizer(element:Object, options?:IEqualizerOptions): Foundation.Equalizer; + Interchange(element:Object, options?:IInterChangeOptions): Foundation.Interchange; + Magellan(element:Object, options?:IMagellanOptions): Foundation.Magellan; + OffCanvas(element:Object, options?:IOffCanvasOptions): Foundation.OffCanvas; + Orbit(element:Object, options?:IOrbitOptions): Foundation.Orbit; + Reveal(element:Object, options?:IRevealOptions): Foundation.Reveal; + Slider(element:Object, options?:ISliderOptions): Foundation.Slider; + Sticky(element:Object, options?:IStickyOptions): Foundation.Sticky; + Tabs(element:Object, options?:ITabsOptions): Foundation.Tabs; + Toggler(element:Object, options?:ITogglerOptions): Foundation.Toggler; + Tooltip(element:Object, options?:ITooltipOptions): Foundation.Tooltip; + + // utils + Box: Foundation.Box; + KeyBoard: Foundation.Box; + MediaQuery: Foundation.MediaQuery; + Motion: Foundation.Motion; + Move: Foundation.Move; + Nest: Foundation.Nest; + Timer: Foundation.Timer; + Touch: Foundation.Touch; + Triggers: Foundation.Triggers; } } interface JQuery { - foundation(method:String|Array) : JQuery; + foundation(method?:String|Array) : JQuery; } declare var Foundation:Foundation.FoundationStatic; diff --git a/foundation/foundation-tests.ts b/foundation/foundation-tests.ts index 9706fbf97..ff7bb015b 100644 --- a/foundation/foundation-tests.ts +++ b/foundation/foundation-tests.ts @@ -344,3 +344,4 @@ $(document).foundation("reflow"); plugin_list().forEach((plugin) => $(document).foundation(plugin, "reflow")); $(document).foundation("slider", "set_value", 100); +Foundatio From 326a957e9df792e9d184f7567820f1280ea5ad41 Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Thu, 3 Dec 2015 11:20:18 +0100 Subject: [PATCH 047/134] update to tests --- foundation-sites/foundation-tests.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts index ca5bf283a..8daba37ac 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-tests.ts @@ -11,7 +11,10 @@ $(document).foundation(); $(document).foundation('method'); $(document).foundation(['method', 'method2']); -function pluginList(){ +function pluginList() { + + 'use strict'; + return [ 'Abide', 'Accordion', From dc1a12df3ef2c2f308581a7b6c72ec717ddfde63 Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Thu, 3 Dec 2015 11:20:41 +0100 Subject: [PATCH 048/134] update to tests --- foundation-sites/foundation-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts index 8daba37ac..f7da5e49c 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-tests.ts @@ -38,5 +38,5 @@ function pluginList() { pluginList().forEach((value:String) => { Foundation[value].($('.selector')); - Foundation[value].($('.selector'), {}, []); + Foundation[value].($('.selector'), {}); }); From 4e7e79f99f5acb6e17f310775f69ccc0b47ceb45 Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Thu, 3 Dec 2015 11:22:02 +0100 Subject: [PATCH 049/134] update to change i shouldn't have done :) --- foundation/foundation-tests.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/foundation/foundation-tests.ts b/foundation/foundation-tests.ts index ff7bb015b..9706fbf97 100644 --- a/foundation/foundation-tests.ts +++ b/foundation/foundation-tests.ts @@ -344,4 +344,3 @@ $(document).foundation("reflow"); plugin_list().forEach((plugin) => $(document).foundation(plugin, "reflow")); $(document).foundation("slider", "set_value", 100); -Foundatio From 283cf3643ef1774fa0a95b1ab383a0efe3cf8eba Mon Sep 17 00:00:00 2001 From: Igor Kriklivetc Date: Thu, 3 Dec 2015 15:33:46 +0300 Subject: [PATCH 050/134] Update to 15.2.3 --- devextreme/devextreme-15.1.8.d.ts | 6580 +++++++++++++++++++++++++++++ devextreme/devextreme.d.ts | 1587 +++++-- 2 files changed, 7741 insertions(+), 426 deletions(-) create mode 100644 devextreme/devextreme-15.1.8.d.ts diff --git a/devextreme/devextreme-15.1.8.d.ts b/devextreme/devextreme-15.1.8.d.ts new file mode 100644 index 000000000..83e69504b --- /dev/null +++ b/devextreme/devextreme-15.1.8.d.ts @@ -0,0 +1,6580 @@ +// Type definitions for DevExtreme 15.1.8 +// Project: http://js.devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module DevExpress { + /** A mixin that provides a capability to fire and subscribe to events. */ + export interface EventsMixin { + /** Subscribes to a specified event. */ + on(eventName: string, eventHandler: Function): T; + /** Subscribes to the specified events. */ + on(events: { [eventName: string]: Function; }): T; + /** Detaches all event handlers from the specified event. */ + off(eventName: string): Object; + /** Detaches a particular event handler from the specified event. */ + off(eventName: string, eventHandler: Function): T; + } + /** An object that serves as a namespace for the methods required to perform validation. */ + export module validationEngine { + export interface IValidator { + validate(): ValidatorValidationResult; + reset(): void; + } + export interface ValidatorValidationResult { + isValid: boolean; + name?: string; + value: any; + brokenRule: any; + validationRules: any[]; + } + export interface ValidationGroupValidationResult { + isValid: boolean; + brokenRules: any[]; + validators: IValidator[]; + } + export interface GroupConfig extends EventsMixin { + group: any; + validators: IValidator[]; + validate(): ValidationGroupValidationResult; + reset(): void; + } + /** Provides access to the object that represents the specified validation group. */ + export function getGroupConfig(group: any): GroupConfig + /** Provides access to the object that represents the default validation group. */ + export function getGroupConfig(): GroupConfig + /** Validates rules of the validators that belong to the specified validation group. */ + export function validateGroup(group: any): ValidationGroupValidationResult; + /** Validates rules of the validators that belong to the default validation group. */ + export function validateGroup(): ValidationGroupValidationResult; + /** Resets the values and validation result of the editors that belong to the specified validation group. */ + export function resetGroup(group: any): void; + /** Resets the values and validation result of the editors that belong to the default validation group. */ + export function resetGroup(): void; + /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ + export function validateModel(model: Object): ValidationGroupValidationResult; + /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ + export function registerModelForValidation(model: Object) : void; + } + export var hardwareBackButton: JQueryCallback; + /** Processes the hardware back button click. */ + export function processHardwareBackButton(): void; + /** Hides the last displayed overlay widget. */ + export function hideTopOverlay(): boolean; + /** Specifies whether or not the entire application/site supports right-to-left representation. */ + export var rtlEnabled: boolean; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, componentClass: Object): void; + /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, namespace: Object, componentClass: Object): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + export function requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + export function cancelAnimationFrame(requestID: number): void; + /** Custom Knockout binding that links an HTML element with a specific action. */ + export class Action { } + /** Used to get URLs that vary in a locally running application and the application running on production. */ + export class EndpointSelector { + constructor(options: { + [key: string]: { + local?: string; + production?: string; + } + }); + /** Returns a local or a productional URL depending on how the application is currently running. */ + urlFor(key: string): string; + } + /** An object that serves as a namespace for the methods that are used to animate UI elements. */ + export module fx { + /** Defines animation options. */ + export interface AnimationOptions { + /** A function called after animation is completed. */ + complete?: (element: JQuery, config: AnimationOptions) => void; + /** A number specifying wait time before animation execution. */ + delay?: number; + /** A number specifying the time period to wait before the animation of the next stagger item starts. */ + staggerDelay?: number; + /** A number specifying the time in milliseconds spent on animation. */ + duration?: number; + /** A string specifying the type of an easing function used for animation. */ + easing?: string; + /** Specifies the initial animation state. */ + from?: any; + /** A function called before animation is started. */ + start?: (element: JQuery, config: AnimationOptions) => void; + /** Specifies a final animation state. */ + to?: any; + /** A string value specifying the animation type. */ + type?: string; + /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ + direction?: string; + } + /** Animates the specified element. */ + export function animate(element: HTMLElement, config: AnimationOptions): Object; + /** Returns a value indicating whether the specified element is being animated. */ + export function isAnimating(element: HTMLElement): boolean; + /** Stops the animation. */ + export function stop(element: HTMLElement, jumpToEnd: boolean): void; + } + /** The manager that performs several specified animations at a time. */ + export class TransitionExecutor { + /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ + reset(): void; + /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ + enter(elements: JQuery, animation: any): void; + /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ + leave(elements: JQuery, animation: any): void; + /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ + start(config: Object): JQueryPromise; + } + export class AnimationPresetCollection { + /** Resets all the changes made in the animation repository. */ + resetToDefaults(): void; + /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ + clear(name: string): void; + /** Adds the specified animation preset to the animation repository by the specified name. */ + registerPreset(name: string, config: any): void; + /** Applies the changes made in the animation repository. */ + applyChanges(): void; + /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ + getPreset(name: string): void; + /** Registers predefined animations in the animation repository. */ + registerDefaultPresets(): void; + } + /** A repository of animations. */ + export var animationPresets: AnimationPresetCollection; + /** The device object defines the device on which the application is running. */ + export interface Device { + /** Indicates whether or not the device platform is Android. */ + android?: boolean; + /** Specifies the type of the device on which the application is running. */ + deviceType?: string; + /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ + generic?: boolean; + /** Indicates whether or not the device platform is iOS. */ + ios?: boolean; + /** Indicates whether or not the device type is 'phone'. */ + phone?: boolean; + /** Specifies the platform of the device on which the application is running. */ + platform?: string; + /** Indicates whether or not the device type is 'tablet'. */ + tablet?: boolean; + /** Specifies an array with the major and minor versions of the device platform. */ + version?: Array; + /** Indicates whether or not the device platform is Windows8. */ + win8?: boolean; + /** Specifies a performance grade of the current device. */ + grade?: string; + } + export class Devices implements EventsMixin { + constructor(options: { window: Window }); + /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ + current(deviceName: any): void; + /** Returns information about the current device. */ + current(): Device; + orientationChanged: JQueryCallback; + /** Returns the current device orientation. */ + orientation(): string; + /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ + real(): Device; + on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + on(eventName: string, eventHandler: Function): Devices; + on(events: { [eventName: string]: Function; }): Devices; + off(eventName: "orientationChanged"): Devices; + off(eventName: string): Devices; + off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + off(eventName: string, eventHandler: Function): Devices; + } + /** An object that serves as a namespace for the methods and events specifying information on the current device. */ + export var devices: Devices; + /** The position object specifies the widget positioning options. */ + export interface PositionOptions { + /** The target element position that the widget is positioned against. */ + at?: string; + /** The element within which the widget is positioned. */ + boundary?: Element; + /** A string value holding horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: string; + /** Specifies how to move the widget if it overflows the screen. */ + collision?: any; + /** The position of the widget to align against the target element. */ + my?: string; + /** The target element that the widget is positioned against. */ + of?: HTMLElement; + /** A string value holding horizontal and vertical offset in pixels, separated by a space (e.g., "5 -10"). */ + offset?: string; + } + export interface ComponentOptions { + /** A handler for the initialized event. */ + onInitialized?: Function; + /** A handler for the optionChanged event. */ + onOptionChanged?: Function; + /** A handler for the disposing event. */ + onDisposing?: Function; + } + /** A base class for all components and widgets. */ + export class Component { + constructor(options?: ComponentOptions) + /** Prevents the component from refreshing until the endUpdate method is called. */ + beginUpdate(): void; + /** Enables the component to refresh after the beginUpdate method call. */ + endUpdate(): void; + /** Returns an instance of this component class. */ + instance(): Component; + /** Returns the configuration options of this component. */ + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + inserted?: (values: Object, key: any) => void; + inserting?: (values: Object) => void; + loaded?: (result: Array) => void; + loading?: (loadOptions: LoadOptions) => void; + modified?: () => void; + modifying?: () => void; + removed?: (key: any) => void; + removing?: (key: any) => void; + updated?: (key: any, values: Object) => void; + updating?: (key: any, values: Object) => void; + /** A handler for the modified event. */ + onModified?: () => void; + /** A handler for the modifying event. */ + onModifying?: () => void; + /** A handler for the removed event. */ + onRemoved?: (key: any) => void; + /** A handler for the removing event. */ + onRemoving?: (key: any) => void; + /** A handler for the updated event. */ + onUpdated?: (key: any, values: Object) => void; + /** A handler for the updating event. */ + onUpdating?: (key: any, values: Object) => void; + /** A handler for the loaded event. */ + onLoaded?: (result: Array) => void; + /** A handler for the loading event. */ + onLoading?: (loadOptions: LoadOptions) => void; + /** A handler for the inserted event. */ + onInserted?: (values: Object, key: any) => void; + /** A handler for the inserting event. */ + onInserting?: (values: Object) => void; + /** Specifies the function called when the Store causes an error. */ + errorHandler?: (e: Error) => void; + /** Specifies the key properties within the data associated with the Store. */ + key?: any; + } + export interface LoadOptions { + filter?: Object; + sort?: Object; + select?: Object; + expand?: Object; + group?: Object; + skip?: number; + take?: number; + userData?: Object; + requireTotalCount?: boolean; + } + /** The base class for all Stores. */ + export class Store implements EventsMixin { + inserted: JQueryCallback; + inserting: JQueryCallback; + loaded: JQueryCallback; + loading: JQueryCallback; + modified: JQueryCallback; + modifying: JQueryCallback; + removed: JQueryCallback; + removing: JQueryCallback; + updated: JQueryCallback; + updating: JQueryCallback; + constructor(options?: StoreOptions); + /** Returns the data item specified by the key. */ + byKey(key: any): JQueryPromise; + /** Adds an item to the data associated with this Store. */ + insert(values: Object): JQueryPromise; + /** Returns the key expression specified via the key configuration option. */ + key(): any; + /** Returns the key of the Store item that matches the specified object. */ + keyOf(obj: Object): any; + /** Starts loading data. */ + load(obj?: LoadOptions): JQueryPromise; + /** Removes the data item specified by the key. */ + remove(key: any): JQueryPromise; + /** Obtains the total count of items that will be returned by the load() function. */ + totalCount(options?: { + filter?: Object; + group?: Object; + }): JQueryPromise; + /** Updates the data item specified by the key. */ + update(key: any, values: Object): JQueryPromise; + on(eventName: "removing", eventHandler: (key: any) => void): Store; + on(eventName: "removed", eventHandler: (key: any) => void): Store; + on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "inserting", eventHandler: (values: Object) => void): Store; + on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + on(eventName: "modifying", eventHandler: () => void): Store; + on(eventName: "modified", eventHandler: () => void): Store; + on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + on(eventName: "loaded", eventHandler: (result: Array) => void): Store; + on(eventName: string, eventHandler: Function): Store; + on(events: { [eventName: string]: Function; }): Store; + off(eventName: "removing"): Store; + off(eventName: "removed"): Store; + off(eventName: "updating"): Store; + off(eventName: "updated"): Store; + off(eventName: "inserting"): Store; + off(eventName: "inserted"): Store; + off(eventName: "modifying"): Store; + off(eventName: "modified"): Store; + off(eventName: "loading"): Store; + off(eventName: "loaded"): Store; + off(eventName: string): Store; + off(eventName: "removing", eventHandler: (key: any) => void): Store; + off(eventName: "removed", eventHandler: (key: any) => void): Store; + off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "inserting", eventHandler: (values: Object) => void): Store; + off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + off(eventName: "modifying", eventHandler: () => void): Store; + off(eventName: "modified", eventHandler: () => void): Store; + off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + off(eventName: "loaded", eventHandler: (result: Array) => void): Store; + off(eventName: string, eventHandler: Function): Store; + } + export interface ArrayStoreOptions extends StoreOptions { + /** Specifies the array associated with this Store. */ + data?: Array; + } + /** A Store accessing an in-memory array. */ + export class ArrayStore extends Store { + constructor(options?: ArrayStoreOptions); + /** Clears all data associated with the current ArrayStore. */ + clear(): void; + /** Creates the Query object for the underlying array. */ + createQuery(): Query; + } + interface Promise { + then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; + } + export interface CustomStoreOptions extends StoreOptions { + /** The user implementation of the byKey(key, extraOptions) method. */ + byKey?: (key: any) => Promise; + /** The user implementation of the insert(values) method. */ + insert?: (values: Object) => Promise; + /** The user implementation of the load(options) method. */ + load?: (options?: LoadOptions) => Promise; + /** The user implementation of the remove(key) method. */ + remove?: (key: any) => Promise; + /** The user implementation of the totalCount(options) method. */ + totalCount?: (options?: { + filter?: Object; + group?: Object; + }) => Promise; + /** The user implementation of the update(key, values) method. */ + update?: (key: any, values: Object) => Promise; + } + /** A Store object that enables you to implement your own data access logic. */ + export class CustomStore extends Store { + constructor(options: CustomStoreOptions); + } + export interface DataSourceOptions { + /** Specifies data filtering conditions. */ + filter?: Object; + /** Specifies data grouping conditions. */ + group?: Object; + /** The item mapping function. */ + map?: (record: any) => any; + /** Specifies the maximum number of items the page can contain. */ + pageSize?: number; + /** Specifies whether a DataSource loads data by pages, or all items at once. */ + paginate?: boolean; + /** The data post processing function. */ + postProcess?: (data: any[]) => any[]; + /** Specifies a value by which the required items are searched. */ + searchExpr?: Object; + /** Specifies the comparison operation used to search for the required items. */ + searchOperation?: string; + /** Specifies the value to which the search expression is compared. */ + searchValue?: Object; + /** Specifies the initial select option value. */ + select?: Object; + /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ + expand?: Object; + /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ + requireTotalCount?: boolean; + /** Specifies the initial sort option value. */ + sort?: Object; + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Error) => void; + } + /** An object that provides access to a data web service or local data storage for collection container widgets. */ + export class DataSource implements EventsMixin { + constructor(options?: DataSourceOptions); + changed: JQueryCallback; + loadError: JQueryCallback; + loadingChanged: JQueryCallback; + /** Disposes all resources associated with this DataSource. */ + dispose(): void; + /** Returns the current filter option value. */ + filter(): Object; + /** Sets the filter option value. */ + filter(filterExpr: Object): void; + /** Returns the current group option value. */ + group(): Object; + /** Sets the group option value. */ + group(groupExpr: Object): void; + /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ + isLastPage(): boolean; + /** Indicates whether or not at least one load() method execution has successfully finished. */ + isLoaded(): boolean; + /** Indicates whether or not the DataSource is currently being loaded. */ + isLoading(): boolean; + /** Returns the array of items currently operated by the DataSource. */ + items(): Array; + /** Returns the key expression. */ + key(): any; + /** Starts loading data. */ + load(): JQueryPromise>; + /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ + loadOptions(): Object; + /** Returns the current pageSize option value. */ + pageSize(): number; + /** Sets the pageSize option value. */ + pageSize(value: number): void; + /** Specifies the index of the currently loaded page. */ + pageIndex(): number; + /** Specifies the index of the page to be loaded during the next load() method execution. */ + pageIndex(newIndex: number): void; + /** Returns the current paginate option value. */ + paginate(): boolean; + /** Sets the paginate option value. */ + paginate(value: boolean): void; + /** Returns the searchExpr option value. */ + searchExpr(): Object; + /** Sets the searchExpr option value. */ + searchExpr(expr: Object): void; + /** Returns the currently specified search operation. */ + searchOperation(): string; + /** Sets the current search operation. */ + searchOperation(op: string): void; + /** Returns the searchValue option value. */ + searchValue(): Object; + /** Sets the searchValue option value. */ + searchValue(value: Object): void; + /** Returns the current select option value. */ + select(): Object; + /** Sets the select option value. */ + select(expr: Object): void; + /** Returns the current requireTotalCount option value. */ + requireTotalCount(): boolean; + /** Sets the requireTotalCount option value. */ + requireTotalCount(value: boolean): void; + /** Returns the current sort option value. */ + sort(): Object; + /** Sets the sort option value. */ + sort(sortExpr: Object): void; + /** Returns the underlying Store instance. */ + store(): Store; + /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ + totalCount(): number; + on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + on(eventName: "changed", eventHandler: () => void): DataSource; + on(eventName: string, eventHandler: Function): DataSource; + on(events: { [eventName: string]: Function; }): DataSource; + off(eventName: "loadingChanged"): DataSource; + off(eventName: "loadError"): DataSource; + off(eventName: "changed"): DataSource; + off(eventName: string): DataSource; + off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + off(eventName: "changed", eventHandler: () => void): DataSource; + off(eventName: string, eventHandler: Function): DataSource; + } + /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ + export class EdmLiteral { + /** Creates an EdmLiteral instance and assigns the specified value to it. */ + constructor(value: string); + /** Returns a string representation of the value associated with this EdmLiteral object. */ + valueOf(): string; + } + /** An object used to generate and hold the GUID. */ + export class Guid { + /** Creates a new Guid instance that holds the specified GUID. */ + constructor(value: string); + /** Creates a new Guid instance holding the generated GUID. */ + constructor(); + /** Returns a string representation of the Guid instance. */ + toString(): string; + /** Returns a string representation of the Guid instance. */ + valueOf(): string; + } + export interface LocalStoreOptions extends ArrayStoreOptions { + /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ + flushInterval?: number; + /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ + immediate?: boolean; + /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ + name?: string; + } + /** A Store providing access to the HTML5 Web Storage. */ + export class LocalStore extends ArrayStore { + constructor(options?: LocalStoreOptions); + /** Removes all data associated with this Store. */ + clear(): void; + } + export interface ODataContextOptions extends ODataStoreOptions { + /** Specifies the list of entities to be accessed via the ODataContext. */ + entities?: Object; + /** Specifies the function called if the ODataContext causes an error. */ + errorHandler?: (e: Error) => void; + } + /** Provides access to the entire OData service. */ + export class ODataContext { + constructor(options?: ODataContextOptions); + /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ + get(operationName: string, params: Object): JQueryPromise; + /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ + invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; + /** Return a special proxy object to describe the entity link. */ + objectLink(entityAlias: string, key: any): Object; + } + export interface ODataStoreOptions extends StoreOptions { + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: { + url: string; + method: string; + timeout: number; + params: Object; + payload: Object; + headers: Object; + }) => void; + /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ + jsonp?: boolean; + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ + keyType?: any; + /** Specifies the URL of the data service being accessed via the current ODataContext. */ + url?: string; + /** Specifies the version of the OData protocol used to interact with the data service. */ + version?: number; + /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ + withCredentials?: boolean; + } + /** A Store providing access to a separate OData web service entity. */ + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + /** Creates the Query object for the OData endpoint. */ + createQuery(loadOptions: Object): Object; + /** Returns the data item specified by the key. */ + byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; + } + /** An universal chainable data query interface object. */ + export interface Query { + /** Calculates a custom summary for the items in the current Query. */ + aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; + /** Calculates a custom summary for the items in the current Query. */ + aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; + /** Calculates the average item value for the current Query. */ + avg(getter: Object): JQueryPromise; + /** Finds the item with the maximum getter value. */ + max(getter: Object): JQueryPromise; + /** Finds the item with the maximum value in the Query. */ + max(): JQueryPromise; + /** Finds the item with the minimum value in the Query. */ + min(): JQueryPromise; + /** Finds the item with the minimum getter value. */ + min(getter: Object): JQueryPromise; + /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ + avg(): JQueryPromise; + /** Returns the total count of items in the current Query. */ + count(): JQueryPromise; + /** Executes the Query. */ + enumerate(): JQueryPromise; + /** Filters the current Query data. */ + filter(criteria: Array): Query; + /** Groups the current Query data. */ + groupBy(getter: Object): Query; + /** Applies the specified transformation to each item. */ + select(getter: Object): Query; + /** Limits the data item count. */ + slice(skip: number, take?: number): Query; + /** Sorts current Query data. */ + sortBy(getter: Object, desc: boolean): Query; + /** Sorts current Query data. */ + sortBy(getter: Object): Query; + /** Calculates the sum of item getter values in the current Query. */ + sum(getter: Object): JQueryPromise; + /** Calculates the sum of item values in the current Query. */ + sum(): JQueryPromise; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object): Query; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object, desc: boolean): Query; + /** Returns the array of current Query items. */ + toArray(): Array; + } + /** The global data layer error handler. */ + export var errorHandler: (e: Error) => void; + /** Encodes the specified string or array of bytes to base64 encoding. */ + export function base64_encode(input: any): string; + /** Creates a Query instance. */ + export function query(array: Array): Query; + /** Creates a Query instance for accessing the remote service specified by a URL. */ + export function query(url: string, queryOptions: Object): Query; + /** This section describes the utility objects provided by the DevExtreme data layer. */ + export var utils: { + /** Compiles a getter function from the getter expression. */ + compileGetter(expr: any): Function; + /** Compiles a setter function from the setter expression. */ + compileSetter(expr: any): Function; + odata: { + /** Holds key value converters for OData. */ + keyConverters: { + String(value: any): string; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + Guid(value: any): Guid; + Boolean(value: any): boolean; + Single(value: any): EdmLiteral; + Decimal(value: any): EdmLiteral; + }; + } + } + } + /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ + export module ui { + export interface WidgetOptions extends DOMComponentOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + /** Specifies a shortcut key that sets focus on the widget element. */ + accessKey?: string; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** Specifies the widget tab index. */ + tabIndex?: number; + /** Specifies the text of the hint displayed for the widget. */ + hint?: string; + } + /** The base class for widgets. */ + export class Widget extends DOMComponent { + constructor(options?: WidgetOptions); + /** Redraws the widget. */ + repaint(): void; + /** Sets focus on the widget. */ + focus(): void; + /** Registers a handler when a specified key is pressed. */ + registerKeyHandler(key: string, handler: Function): void; + } + export interface CollectionWidgetOptions extends WidgetOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + itemClickAction?: any; + itemHoldAction?: Function; + /** The time period in milliseconds before the onItemHold event is raised. */ + itemHoldTimeout?: number; + itemRender?: any; + itemRenderedAction?: Function; + /** An array of items displayed by the widget. */ + items?: Array; + /** + * A function performed when a widget item is selected. + * @deprecated onSelectionChanged.md + */ + itemSelectAction?: Function; + /** The template to be used for rendering items. */ + itemTemplate?: any; + loopItemFocus?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + onContentReady?: any; + contentReadyAction?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemContextMenu event. */ + onItemContextMenu?: Function; + /** A handler for the itemHold event. */ + onItemHold?: Function; + /** A handler for the itemRendered event. */ + onItemRendered?: Function; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The index of the currently selected widget item. */ + selectedIndex?: number; + /** The selected item object. */ + selectedItem?: Object; + /** An array of currently selected item objects. */ + selectedItems?: Array; + /** A handler for the itemDeleting event. */ + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + } + /** The base class for widgets containing an item collection. */ + export class CollectionWidget extends Widget { + constructor(element: JQuery, options?: CollectionWidgetOptions); + constructor(element: HTMLElement, options?: CollectionWidgetOptions); + selectItem(itemElement: any): void; + unselectItem(itemElement: any): void; + deleteItem(itemElement: any): JQueryPromise; + isItemSelected(itemElement: any): boolean; + reorderItem(itemElement: any, toItemElement: any): JQueryPromise; + } + export interface DataExpressionMixinOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of a data source item field whose value is held in the value configuration option. */ + valueExpr?: any; + itemRender?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** The currently selected value in the widget. */ + value?: Object; + } + export interface EditorOptions extends WidgetOptions { + /** The currently specified value. */ + value?: Object; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + valueChangeAction?: Function; + /** A Boolean value specifying whether or not the widget is read-only. */ + readOnly?: boolean; + /** Holds the object that defines the error that occurred during validation. */ + validationError?: Object; + /** Specifies whether the editor's value is valid. */ + isValid?: boolean; + /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ + validationMessageMode?: string; + } + /** A base class for editors. */ + export class Editor extends Widget { + /** Resets the editor's value to undefined. */ + reset(): void; + } + /** An object that serves as a namespace for methods displaying a message in an application/site. */ + export var dialog: { + /** Creates an alert dialog message containing a single "OK" button. */ + alert(message: string, title: string): JQueryPromise; + /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ + confirm(message: string, title: string): JQueryPromise; + /** Creates a custom dialog using the options specified by the passed configuration object. */ + custom(options: { title?: string; message?: string; buttons?: Array; }): { + show(): JQueryPromise; + hide(): void; + hide(value: any): void; + }; + }; + /** Creates a toast message. */ + export function notify(message: any, type: string, displayTime: number): void; + /** Creates a toast message. */ + export function notify(options: Object): void; + /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ + export var themes: { + /** Returns the name of the currently applied theme. */ + current(): string; + /** Changes the current theme to the specified one. */ + current(themeName: string): void; + }; + /** Sets a specified template engine. */ + export function setTemplateEngine(name: string): void; + /** Sets a custom template engine defined via custom compile and render functions. */ + export function setTemplateEngine(options: Object): void; + } + /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ + export var utils: { + /** Sets parameters for the viewport meta tag. */ + initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + }; + /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ + export module viz { + /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(theme: string): void; + /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(platform: string, colorScheme: string): void; + /** Registers a new theme based on the existing one. */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Applies a predefined or registered custom palette to all visualization widgets at once. */ + export function currentPalette(paletteName: string): void; + /** Obtains the color sets of a predefined or registered palette. */ + export function getPalette(paletteName: string): Object; + /** Registers a new palette. */ + export function registerPalette(paletteName: string, palette: Object): void; + } +} +declare module DevExpress.ui { + export interface dxValidatorOptions extends DOMComponentOptions { + /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ + validationRules?: Array; + /** Specifies the editor name to be used in the validation default messages. */ + name?: string; + /** An object that specifies what and when to validate and how to apply the validation result. */ + adapter?: Object; + /** Specifies the validation group the editor will be related to. */ + validationGroup?: string; + /** A handler for the validated event. */ + onValidated?: (params: validationEngine.ValidatorValidationResult) => void; + } + /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ + export class dxValidator extends DOMComponent implements validationEngine.IValidator { + constructor(element: JQuery, options?: dxValidatorOptions); + constructor(element: Element, options?: dxValidatorOptions); + /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ + validate(): validationEngine.ValidatorValidationResult; + /** Resets the value and validation result of the editor associated with the current dxValidator object. */ + reset(): void; + } + /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + export class dxValidationGroup extends DOMComponent { + constructor(element: JQuery); + constructor(element: Element); + /** Validates rules of the validators that belong to the current validation group. */ + validate(): validationEngine.ValidationGroupValidationResult; + /** Resets the value and validation result of the editors that are included to the current validation group. */ + reset(): void; + } + export interface dxValidationSummaryOptions extends CollectionWidgetOptions { + /** Specifies the validation group for which summary should be generated. */ + validationGroup?: string; + } + /** A widget for displaying the result of checking validation rules for editors. */ + export class dxValidationSummary extends CollectionWidget { + constructor(element: JQuery, options?: dxValidationSummaryOptions); + constructor(element: Element, options?: dxValidationSummaryOptions); + } + export interface dxResizableOptions extends DOMComponentOptions { + /** Specifies which borders of the widget element are used as a handle. */ + handles?: string; + /** Specifies the lower width boundary for resizing. */ + minWidth?: number; + /** Specifies the upper width boundary for resizing. */ + maxWidth?: number; + /** Specifies the lower height boundary for resizing. */ + minHeight?: number; + /** Specifies the upper height boundary for resizing. */ + maxHeight?: number; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + } + /** A widget that displays required content in a resizable element. */ + export class dxResizable extends DOMComponent { + constructor(element: JQuery, options?: dxResizableOptions); + constructor(element: Element, options?: dxResizableOptions); + } + export interface dxTooltipOptions extends dxPopoverOptions { + } + /** A tooltip widget. */ + export class dxTooltip extends dxPopover { + constructor(element: JQuery, options?: dxTooltipOptions); + constructor(element: Element, options?: dxTooltipOptions); + } + export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { + /** Returns the value currently displayed by the widget. */ + displayValue?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ + searchExpr?: Object; + /** Specifies the binary operation used to filter data. */ + searchMode?: string; + /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ + searchTimeout?: number; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget supports searching. */ + searchEnabled?: boolean; + /** + * Specifies whether or not the widget displays items by pages. + * @deprecated dataSource.paginate.md + */ + pagingEnabled?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** A handler for the itemClick event. */ + onItemClick?: Function; + onContentReady?: Function; + } + /** A base class for drop-down list widgets. */ + export class dxDropDownList extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDropDownListOptions); + constructor(element: Element, options?: dxDropDownListOptions); + } + export interface dxToolbarOptions extends CollectionWidgetOptions { + menuItemRender?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** Informs the widget about its location in a view HTML markup. */ + renderAs?: string; + } + /** A toolbar widget. */ + export class dxToolbar extends CollectionWidget { + constructor(element: JQuery, options?: dxToolbarOptions); + constructor(element: Element, options?: dxToolbarOptions); + } + export interface dxToastOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** The time span in milliseconds during which the dxToast widget is visible. */ + displayTime?: number; + height?: any; + /** The dxToast message text. */ + message?: string; + position?: PositionOptions; + shading?: boolean; + /** Specifies the dxToast widget type. */ + type?: string; + width?: any; + closeOnBackButton?: boolean; + } + /** The toast message widget. */ + export class dxToast extends dxOverlay { + constructor(element: JQuery, options?: dxToastOptions); + constructor(element: Element, options?: dxToastOptions); + } + export interface dxTextEditorOptions extends EditorOptions { + /** A handler for the change event. */ + onChange?: Function; + changeAction?: Function; + /** A handler for the copy event. */ + onCopy?: Function; + copyAction?: Function; + /** A handler for the cut event. */ + onCut?: Function; + cutAction?: Function; + /** A handler for the enterKey event. */ + onEnterKey?: Function; + enterKeyAction?: Function; + /** A handler for the focusIn event. */ + onFocusIn?: Function; + focusInAction?: Function; + /** A handler for the focusOut event. */ + onFocusOut?: Function; + focusOutAction?: Function; + /** A handler for the input event. */ + onInput?: Function; + inputAction?: Function; + /** A handler for the keyDown event. */ + onKeyDown?: Function; + keyDownAction?: Function; + /** A handler for the keyPress event. */ + onKeyPress?: Function; + keyPressAction?: Function; + /** A handler for the keyUp event. */ + onKeyUp?: Function; + keyUpAction?: Function; + /** A handler for the paste event. */ + onPaste?: Function; + pasteAction?: Function; + /** The text displayed by the widget when the widget value is empty. */ + placeholder?: string; + /** Specifies whether to display the Clear button in the widget. */ + showClearButton?: boolean; + /** Specifies the current value displayed by the widget. */ + value?: any; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies HTML attributes applied to the inner input element of the widget. */ + attr?: Object; + /** The read-only option that holds the text displayed by the widget input element. */ + text?: string; + /** Specifies whether or not the widget supports the focused state and keyboard navigation. */ + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** The editor mask that specifies the format of the entered string. */ + mask?: string; + /** Specifies a mask placeholder character. */ + maskChar?: string; + /** Specifies custom mask rules. */ + maskRules?: Object; + /** A message displayed when the entered text does not match the specified pattern. */ + maskInvalidMessage?: string; + } + /** A base class for text editing widgets. */ + export class dxTextEditor extends Editor { + constructor(element: JQuery, options?: dxTextEditorOptions); + constructor(element: Element, options?: dxTextEditorOptions); + /** Removes focus from the input element. */ + blur(): void; + /** Sets focus to the input element representing the widget. */ + focus(): void; + } + export interface dxTextBoxOptions extends dxTextEditorOptions { + /** Specifies the maximum number of characters you can enter into the textbox. */ + maxLength?: any; + /** The "mode" attribute value of the actual HTML input element representing the text box. */ + mode?: string; + } + /** A single-line text box widget. */ + export class dxTextBox extends dxTextEditor { + constructor(element: JQuery, options?: dxTextBoxOptions); + constructor(element: Element, options?: dxTextBoxOptions); + } + export interface dxTextAreaOptions extends dxTextBoxOptions { + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + } + /** A widget used to display and edit multi-line text. */ + export class dxTextArea extends dxTextBox { + constructor(element: JQuery, options?: dxTextAreaOptions); + constructor(element: Element, options?: dxTextAreaOptions); + } + export interface dxTabsOptions extends CollectionWidgetOptions { + /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ + selectionMode?: string; + /** Specifies whether or not an end-user can scroll tabs by swiping. */ + scrollByContent?: boolean; + /** Specifies whether or not an end-user can scroll tabs. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A tab strip used to switch between pages. */ + export class dxTabs extends CollectionWidget { + constructor(element: JQuery, options?: dxTabsOptions); + constructor(element: Element, options?: dxTabsOptions); + } + export interface dxTabPanelOptions extends dxMultiViewOptions { + /** A handler for the titleClick event. */ + onTitleClick?: any; + /** A handler for the titleHold event. */ + onTitleHold?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + titleTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ + export class dxTabPanel extends dxMultiView { + constructor(element: JQuery, options?: dxTabPanelOptions); + constructor(element: Element, options?: dxTabPanelOptions); + } + export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + /** The text that is provided as a hint in the select box editor. */ + placeholder?: string; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + } + /** A widget that allows you to select an item in a dropdown list. */ + export class dxSelectBox extends dxDropDownList { + constructor(element: JQuery, options?: dxSelectBoxOptions); + constructor(element: Element, options?: dxSelectBoxOptions); + } + export interface dxTagBoxOptions extends dxSelectBoxOptions { + /** Holds the list of selected values. */ + values?: Array; + } + /** A widget that allows you to select multiple items from a dropdown list. */ + export class dxTagBox extends dxSelectBox { + constructor(element: JQuery, options?: dxTagBoxOptions); + constructor(element: Element, options?: dxTagBoxOptions); + } + export interface dxScrollViewOptions extends dxScrollableOptions { + /** A handler for the pullDown event. */ + onPullDown?: Function; + pullDownAction?: Function; + /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the reachBottom event. */ + onReachBottom?: Function; + reachBottomAction?: Function; + /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ + reachBottomText?: string; + /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ + refreshingText?: string; + /** Returns a value indicating if the scrollView content is larger then the widget container. */ + isFull(): boolean; + /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ + refresh(): void; + /** Notifies the scroll view that data loading is finished. */ + release(preventScrollBottom: boolean): JQueryPromise; + /** Toggles the loading state of the widget. */ + toggleLoading(showOrHide: boolean): void; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); + } + export interface dxScrollableLocation { + top?: number; + left?: number; + } + export interface dxScrollableOptions extends DOMComponentOptions { + /** A string value specifying the available scrolling directions. */ + direction?: string; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A handler for the scroll event. */ + onScroll?: Function; + scrollAction?: Function; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** A handler for the update event. */ + onUpdated?: Function; + updateAction?: Function; + /** Indicates whether to use native or simulated scrolling. */ + useNative?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ + scrollByThumb?: boolean; + } + /** A widget used to display scrollable content. */ + export class dxScrollable extends DOMComponent { + constructor(element: JQuery, options?: dxScrollableOptions); + constructor(element: Element, options?: dxScrollableOptions); + /** Returns the height of the scrollable widget in pixels. */ + clientHeight(): number; + /** Returns the width of the scrollable widget in pixels. */ + clientWidth(): number; + /** Returns an HTML element of the widget. */ + content(): JQuery; + /** Scrolls the widget content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ + scrollBy(distanceObject: dxScrollableLocation): void; + /** Returns the height of the scrollable content in pixels. */ + scrollHeight(): number; + /** Returns the current scroll position against the leftmost position. */ + scrollLeft(): number; + /** Returns how far the scrollable content is scrolled from the top and from the left. */ + scrollOffset(): dxScrollableLocation; + /** Scrolls widget content to the specified position. */ + scrollTo(targetLocation: number): void; + /** Scrolls widget content to a specified position. */ + scrollTo(targetLocation: dxScrollableLocation): void; + /** Scrolls widget content to the specified element. */ + scrollToElement(element: Element): void; + /** Returns the current scroll position against the topmost position. */ + scrollTop(): number; + /** Returns the width of the scrollable content in pixels. */ + scrollWidth(): number; + /** Updates the dimensions of the scrollable contents. */ + update(): void; + } + export interface dxRadioGroupOptions extends CollectionWidgetOptions, DataExpressionMixinOptions { + /** Specifies the radio group layout. */ + layout?: string; + } + /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ + export class dxRadioGroup extends CollectionWidget { + constructor(element: JQuery, options?: dxRadioGroupOptions); + constructor(element: Element, options?: dxRadioGroupOptions); + } + export interface dxPopupOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** Specifies whether or not to allow a user to drag the popup window. */ + dragEnabled?: boolean; + /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ + fullScreen?: boolean; + position?: PositionOptions; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showTitle?: boolean; + /** The title in the overlay window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + width?: any; + /** Specifies items displayed on the top or bottom toolbar of the popup window. */ + buttons?: Array; + /** Specifies whether or not the widget displays the Close button. */ + showCloseButton?: boolean; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + } + /** A widget that displays required content in a popup window. */ + export class dxPopup extends dxOverlay { + constructor(element: JQuery, options?: dxPopupOptions); + constructor(element: Element, options?: dxPopupOptions); + } + export interface dxPopoverOptions extends dxPopupOptions { + /** An object defining animation options of the widget. */ + animation?: fx.AnimationOptions; + /** Specifies the height of the widget. */ + height?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + shading?: boolean; + /** A Boolean value specifying whether or not to display the title in the overlay window. */ + showTitle?: boolean; + /** The target element associated with a popover. */ + target?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A widget that displays the required content in a popup window. */ + export class dxPopover extends dxPopup { + constructor(element: JQuery, options?: dxPopoverOptions); + constructor(element: Element, options?: dxPopoverOptions); + /** Displays the widget for the specified target element. */ + show(target?: any): JQueryPromise; + } + export interface dxOverlayOptions extends WidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ + closeOnOutsideClick?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + /** Specifies whether or not an end-user can drag the widget. */ + dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** The height of the widget in pixels. */ + height?: any; + /** A handler for the hidden event. */ + onHidden?: Function; + hiddenAction?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + hidingAction?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ + shading?: boolean; + /** Specifies the shading color. */ + shadingColor?: string; + /** A handler for the showing event. */ + onShowing?: Function; + showingAction?: Function; + /** A handler for the shown event. */ + onShown?: Function; + shownAction?: Function; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** The widget width in pixels. */ + width?: any; + } + /** A widget displaying the required content in an overlay window. */ + export class dxOverlay extends Widget { + constructor(element: JQuery, options?: dxOverlayOptions); + constructor(element: Element, options?: dxOverlayOptions); + /** An HTML element of the widget. */ + content(): JQuery; + /** Hides the widget. */ + hide(): JQueryPromise; + /** Recalculates the overlay's size and position. */ + repaint(): void; + /** Shows the widget. */ + show(): JQueryPromise; + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** A static method that specifies the base z-index for all overlay widgets. */ + static baseZIndex(zIndex: number): void; + } + export interface dxNumberBoxOptions extends dxTextEditorOptions { + /** The maximum value accepted by the number box. */ + max?: number; + /** The minimum value accepted by the number box. */ + min?: number; + /** Specifies whether or not to show spin buttons. */ + showSpinButtons?: boolean; + useTouchSpinButtons?: boolean; + /** Specifies by which value the widget value changes when a spin button is clicked. */ + step?: number; + /** The current number box value. */ + value?: number; + } + /** A textbox widget that enables a user to enter numeric values. */ + export class dxNumberBox extends dxTextEditor { + constructor(element: JQuery, options?: dxNumberBoxOptions); + constructor(element: Element, options?: dxNumberBoxOptions); + } + export interface dxNavBarOptions extends dxTabsOptions { + scrollingEnabled?: boolean; + } + /** A widget that contains items used to navigate through application views. */ + export class dxNavBar extends dxTabs { + constructor(element: JQuery, options?: dxNavBarOptions); + constructor(element: Element, options?: dxNavBarOptions); + } + export interface dxMultiViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently displayed item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget used to display a view and to switch between several views. */ + export class dxMultiView extends CollectionWidget { + constructor(element: JQuery, options?: dxMultiViewOptions); + constructor(element: Element, options?: dxMultiViewOptions); + } + export interface dxMapOptions extends WidgetOptions { + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route. */ + autoAdjust?: boolean; + /** An object, a string, or an array specifying the location displayed at the center of the widget. */ + center?: { + /** The latitude location displayed in the center of the widget. */ + lat?: number; + /** The longitude location displayed in the center of the widget. */ + lng?: number; + }; + /** A handler for the click event. */ + onClick?: any; + clickAction?: any; + /** Specifies whether or not map widget controls are available. */ + controls?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + markerAddedAction?: Function; + /** A URL pointing to the custom icon to be used for map markers. */ + markerIconSrc?: string; + /** A handler for the markerRemoved event. */ + onMarkerRemoved?: Function; + markerRemovedAction?: Function; + /** An array of markers displayed on a map. */ + markers?: Array; + /** The name of the current map data provider. */ + provider?: string; + /** A handler for the ready event. */ + onReady?: Function; + readyAction?: Function; + /** A handler for the routeAdded event. */ + onRouteAdded?: Function; + routeAddedAction?: Function; + /** A handler for the routeRemoved event. */ + onRouteRemoved?: Function; + routeRemovedAction?: Function; + /** An array of routes shown on the map. */ + routes?: Array; + /** The type of a map to display. */ + type?: string; + /** Specifies the width of the widget. */ + width?: any; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(routeOptions: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + /** An object defining widget animation options. */ + animation?: fx.AnimationOptions; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlaying window. */ + closeOnOutsideClick?: any; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ + fullScreen?: boolean; + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not to group widget items. */ + grouped?: boolean; + groupRender?: any; + /** The name of the template used to display a group header. */ + groupTemplate?: any; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + pageLoadingAction?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ + pageLoadingText?: string; + /** The text displayed by the widget when nothing is selected. */ + placeholder?: string; + /** The height of the widget popup element. */ + popupHeight?: any; + /** The width of the widget popup element. */ + popupWidth?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + pullRefreshAction?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + scrollAction?: Function; + /** A Boolean value specifying whether or not the search bar is visible. */ + searchEnabled?: boolean; + /** The text that is provided as a hint in the lookup's search bar. */ + searchPlaceholder?: string; + /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ + shading?: boolean; + /** Specifies whether to display the Cancel button in the lookup window. */ + showCancelButton?: boolean; + /** + * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. + * @deprecated pageLoadMode.md + */ + showNextButton?: boolean; + /** The title of the lookup window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + usePopover?: boolean; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + contentReadyAction?: Function; + titleRender?: any; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showPopupTitle?: boolean; + } + /** A widget that allows a user to select predefined values from a lookup window. */ + export class dxLookup extends dxDropDownList { + constructor(element: JQuery, options?: dxLookupOptions); + constructor(element: Element, options?: dxLookupOptions); + /** This section lists the data source fields that are used in a default template for lookup drop-down items. */ + } + export interface dxLoadPanelOptions extends dxOverlayOptions { + /** An object defining the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** The delay in milliseconds after which the load panel is displayed. */ + delay?: number; + /** The height of the widget. */ + height?: number; + /** A URL pointing to an image to be used as a load indicator. */ + indicatorSrc?: string; + /** The text displayed in the load panel. */ + message?: string; + /** A Boolean value specifying whether or not to show a load indicator. */ + showIndicator?: boolean; + /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ + showPane?: boolean; + /** The width of the widget. */ + width?: number; + } + /** A widget used to indicate whether or not an element is loading. */ + export class dxLoadPanel extends dxOverlay { + constructor(element: JQuery, options?: dxLoadPanelOptions); + constructor(element: Element, options?: dxLoadPanelOptions); + } + export interface dxLoadIndicatorOptions extends WidgetOptions { + /** Specifies the path to an image used as the indicator. */ + indicatorSrc?: string; + } + /** The widget used to indicate the loading process. */ + export class dxLoadIndicator extends Widget { + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + constructor(element: Element, options?: dxLoadIndicatorOptions); + } + export interface dxListOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not to display a grouped list. */ + grouped?: boolean; + groupRender?: any; + /** The template to be used for rendering item groups. */ + groupTemplate?: any; + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the groupRendered event. */ + onGroupRendered?: Function; + itemDeleteAction?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + itemReorderAction?: Function; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemSwipe event. */ + onItemSwipe?: Function; + itemSwipeAction?: Function; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + pageLoadingAction?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ + pageLoadingText?: string; + /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + pullRefreshAction?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + scrollAction?: Function; + /** A Boolean value specifying whether to enable or disable list scrolling. */ + scrollingEnabled?: boolean; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying if the list is scrolled using the scrollbar. */ + scrollByThumb?: boolean; + itemUnselectAction?: Function; + onItemContextMenu?: Function; + onItemHold?: Function; + /** Specifies whether or not an end-user can collapse groups. */ + collapsibleGroups?: boolean; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies whether or not to display controls used to select list items. */ + showSelectionControls?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + selectAllText?: string; + /** Specifies the array of items for a context menu called for a list item. */ + menuItems?: Array; + /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ + menuMode?: string; + /** Specifies whether or not an end user can delete list items. */ + allowItemDeleting?: boolean; + /** Specifies the way a user can delete items from the list. */ + itemDeleteMode?: string; + /** Specifies whether or not an end user can reorder list items. */ + allowItemReordering?: boolean; + /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ + indicateLoading?: boolean; + activeStateEnabled?: boolean; + } + /** A list widget. */ + export class dxList extends CollectionWidget { + constructor(element: JQuery, options?: dxListOptions); + constructor(element: Element, options?: dxListOptions); + /** Returns the height of the widget in pixels. */ + clientHeight(): number; + /** Removes the specified item from the list. */ + deleteItem(itemIndex: any): JQueryPromise; + /** Removes the specified item from the list. */ + deleteItem(itemElement: Element): JQueryPromise; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemIndex: any): boolean; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemElement: Element): boolean; + /** Reloads list data. */ + reload(): void; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; + /** Scrolls the list content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Returns the height of the list content in pixels. */ + scrollHeight(): number; + /** Scrolls list content to the specified position. */ + scrollTo(location: number): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemElement: Element): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemIndex: any): void; + /** Returns how far the list content is scrolled from the top. */ + scrollTop(): number; + /** Selects the specified item from the list. */ + selectItem(itemElement: Element): void; + /** Selects the specified item from the list. */ + selectItem(itemIndex: any): void; + /** Deselects the specified item from the list. */ + unselectItem(itemElement: Element): void; + /** Unselects the specified item from the list. */ + unselectItem(itemIndex: any): void; + /** Updates the widget scrollbar according to widget content size. */ + updateDimensions(): JQueryPromise; + /** Expands the specified group. */ + expandGroup(groupIndex: number): JQueryPromise; + /** Collapses the specified group. */ + collapseGroup(groupIndex: number): JQueryPromise; + } + export interface dxGalleryOptions extends CollectionWidgetOptions { + /** The time, in milliseconds, spent on slide animation. */ + animationDuration?: number; + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ + indicatorEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently active gallery item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ + showIndicator?: boolean; + /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ + showNavButtons?: boolean; + /** The time interval in milliseconds, after which the gallery switches to the next item. */ + slideshowDelay?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ + wrapAround?: boolean; + /** Specifies if the widget stretches images to fit the total gallery width. */ + stretchImages?: boolean; + /** Specifies the width of an area used to display a single image. */ + initialItemWidth?: number; + } + /** An image gallery widget. */ + export class dxGallery extends CollectionWidget { + constructor(element: JQuery, options?: dxGalleryOptions); + constructor(element: Element, options?: dxGalleryOptions); + /** Shows the specified gallery item. */ + goToItem(itemIndex: number, animation: boolean): JQueryPromise; + /** Shows the next gallery item. */ + nextItem(animation: boolean): JQueryPromise; + /** Shows the previous gallery item. */ + prevItem(animation: boolean): JQueryPromise; + } + export interface dxDropDownEditorOptions extends dxTextBoxOptions { + /** Specifies the current value displayed by the widget. */ + value?: Object; + /** A handler for the closed event. */ + onClosed?: Function; + /** A handler for the opened event. */ + onOpened?: Function; + /** Specifies whether or not the drop-down editor is displayed. */ + opened?: boolean; + closeAction?: Function; + openAction?: Function; + shownAction?: Function; + hiddenAction?: Function; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + editEnabled?: boolean; + /** Specifies the way an end-user applies the selected value. */ + applyValueMode?: string; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A drop-down editor widget. */ + export class dxDropDownEditor extends dxTextBox { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Closes the drop-down editor. */ + close(): void; + /** Opens the drop-down editor. */ + open(): void; + /** Resets the widget's value to null. */ + reset(): void; + /** Returns an <input> element of the widget. */ + field(): JQuery; + /** Returns an HTML element of the popup window content. */ + content(): JQuery; + } + export interface dxDateBoxOptions extends dxTextEditorOptions { + /** A format used to display date/time information. */ + format?: string; + /** A Globalize format string specifying the date display format. */ + formatString?: string; + /** The last date that can be selected within the widget. */ + max?: any; + /** The minimum date that can be selected within the widget. */ + min?: any; + /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ + placeholder?: string; + /** + * Specifies whether or not a user can pick out a date using the drop-down calendar. + * @deprecated Use 'pickerType' option instead. + */ + useCalendar?: boolean; + /** An object or a value, specifying the date and time currently selected using the date box. */ + value?: any; + /** + * Specifies whether or not the widget uses the native HTML input element. + * @deprecated Use 'pickerType' option instead. + */ + useNative?: boolean; + /** Specifies the interval between neighboring values in the popup list in minutes. */ + interval?: number; + /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ + maxZoomLevel?: string; + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + minZoomLevel?: string; + /** Specifies the type of date/time picker. */ + pickerType?: string; + } + /** A date box widget. */ + export class dxDateBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDateBoxOptions); + constructor(element: Element, options?: dxDateBoxOptions); + } + export interface dxCheckBoxOptions extends EditorOptions { + /** Specifies the widget state. */ + value?: boolean; + /** Specifies the text displayed by the check box. */ + text?: string; + } + /** A check box widget. */ + export class dxCheckBox extends Editor { + constructor(element: JQuery, options?: dxCheckBoxOptions); + constructor(element: Element, options?: dxCheckBoxOptions); + } + export interface dxCalendarOptions extends EditorOptions { + /** Specifies a date displayed on the current calendar page. */ + currentDate?: Date; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The latest date the widget allows to select. */ + max?: Date; + /** The earliest date the widget allows to select. */ + min?: Date; + /** Specifies whether or not the widget displays a button that selects the current date. */ + showTodayButton?: boolean; + /** Specifies the current calendar zoom level. */ + zoomLevel?: string; + /** Specifies the maximum zoom level of the calendar. */ + maxZoomLevel?: string; + /** Specifies the minimum zoom level of the calendar. */ + minZoomLevel?: string; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; + } + /** A calendar widget. */ + export class dxCalendar extends Editor { + constructor(element: JQuery, options?: dxCalendarOptions); + constructor(element: Element, options?: dxCalendarOptions); + } + export interface dxButtonOptions extends WidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A handler for the click event. */ + onClick?: any; + clickAction?: any; + /** Specifies the icon to be displayed on the button. */ + icon?: string; + iconSrc?: string; + /** A template to be used for rendering the dxButton widget. */ + template?: any; + /** The text displayed on the button. */ + text?: string; + /** Specifies the button type. */ + type?: string; + /** Specifies the name of the validation group to be accessed in the click event handler. */ + validationGroup?: string; + } + /** A button widget. */ + export class dxButton extends Widget { + constructor(element: JQuery, options?: dxButtonOptions); + constructor(element: Element, options?: dxButtonOptions); + } + export interface dxBoxOptions extends CollectionWidget { + /** Specifies how widget items are aligned along the main direction. */ + align?: string; + /** Specifies the direction of item positioning in the widget. */ + direction?: string; + /** Specifies how widget items are aligned cross-wise. */ + crossAlign?: string; + } + /** A container widget used to arrange inner elements. */ + export class dxBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { + /** Specifies the collection of rows for the grid used to position layout elements. */ + rows?: Array; + /** Specifies the collection of columns for the grid used to position layout elements. */ + cols?: Array; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the screen factor with which all elements are located in a single column. */ + singleColumnScreen?: string; + } + /** A widget used to build an adaptive markup that is dependent on screen resolution. */ + export class dxResponsiveBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxAutocompleteOptions extends dxDropDownListOptions { + /** Specifies the current value displayed by the widget. */ + value?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the maximum count of items displayed by the widget. */ + maxItemCount?: number; + /** Gets the currently selected item. */ + selectedItem?: Object; + } + /** A textbox widget that supports autocompletion. */ + export class dxAutocomplete extends dxDropDownList { + constructor(element: JQuery, options?: dxAutocompleteOptions); + constructor(element: Element, options?: dxAutocompleteOptions); + /** Opens the drop-down editor. */ + open(): void; + /** Closes the drop-down editor. */ + close(): void; + } + export interface dxAccordionOptions extends CollectionWidgetOptions { + /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ + animationDuration?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ + collapsible?: boolean; + /** Specifies whether the widget can expand several items or only a single item at once. */ + multiple?: boolean; + /** The template to be used for rendering dxAccordion items. */ + itemTemplate?: any; + /** A handler for the itemTitleClick event. */ + onItemTitleClick?: any; + /** A handler for the itemTitleHold event. */ + onItemTitleHold?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** The index number of the currently selected item. */ + selectedIndex?: number; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget that displays data source items on collapsible panels. */ + export class dxAccordion extends CollectionWidget { + constructor(element: JQuery, options?: dxAccordionOptions); + constructor(element: Element, options?: dxAccordionOptions); + /** Collapses the specified item. */ + collapseItem(index: number): JQueryPromise; + /** Expands the specified item. */ + expandItem(index: number): JQueryPromise; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + } + export interface dxFileUploaderOptions extends EditorOptions { + /** A read-only option that holds a File instance representing the selected file. */ + value?: File; + /** Holds the File instances representing files selected in the widget. */ + values?: Array; + buttonText?: string; + /** The text displayed on the button that opens the file browser. */ + selectButtonText?: string; + /** The text displayed on the button that starts uploading. */ + uploadButtonText?: string; + /** Specifies the text displayed on the area to which an end-user can drop a file. */ + labelText?: string; + /** Specifies the value passed to the name attribute of the underlying input element. */ + name?: string; + /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ + multiple?: boolean; + /** Specifies a file type or several types accepted by the widget. */ + accept?: string; + /** Specifies a target Url for the upload request. */ + uploadUrl?: string; + /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ + allowCanceling?: boolean; + /** Specifies whether or not the widget displays the list of selected files. */ + showFileList?: boolean; + /** Gets the current progress in percentages. */ + progress?: number; + /** The message displayed by the widget when it is ready to upload the specified files. */ + readyToUploadMessage?: string; + /** The message displayed by the widget when uploading is finished. */ + uploadedMessage?: string; + /** The message displayed by the widget on uploading failure. */ + uploadFailedMessage?: string; + /** Specifies how the widget uploads files. */ + uploadMode?: string; + /** A handler for the uploaded event. */ + onUploaded?: Function; + /** A handler for the uploaded event. */ + onProgress?: Function; + /** A handler for the uploadError event. */ + onUploadError?: Function; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + /** The slider step size. */ + step?: number; + /** The current slider value. */ + value?: number; + /** Specifies whether or not to highlight a range selected within the widget. */ + showRange?: boolean; + /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ + keyStep?: number; + /** Specifies options for the slider tooltip. */ + tooltip?: { + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies format for the tooltip. */ + format?: any; + /** Specifies whether the tooltip is located over or under the slider. */ + position?: string; + /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ + showMode?: string; + }; + /** Specifies options for labels displayed at the min and max values. */ + label?: { + /** Specifies whether or not slider labels are visible. */ + visible?: boolean; + /** Specifies whether labels are located over or under the scale. */ + position?: string; + /** Specifies a format for labels. */ + format?: any; + }; + } + /** A widget that allows a user to select a numeric value within a given range. */ + export class dxSlider extends dxTrackBar { + constructor(element: JQuery, options?: dxSliderOptions); + constructor(element: Element, options?: dxSliderOptions); + } + export interface dxRangeSliderOptions extends dxSliderOptions { + /** The left edge of the interval currently selected using the range slider. */ + start?: number; + /** The right edge of the interval currently selected using the range slider. */ + end?: number; + } + /** A widget that enables a user to select a range of numeric values. */ + export class dxRangeSlider extends dxSlider { + constructor(element: JQuery, options?: dxRangeSliderOptions); + constructor(element: Element, options?: dxRangeSliderOptions); + } +} +interface JQuery { + dxProgressBar(): JQuery; + dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; + dxProgressBar(options: string): any; + dxProgressBar(options: string, ...params: any[]): any; + dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; + dxSlider(): JQuery; + dxSlider(options: "instance"): DevExpress.ui.dxSlider; + dxSlider(options: string): any; + dxSlider(options: string, ...params: any[]): any; + dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; + dxRangeSlider(): JQuery; + dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; + dxRangeSlider(options: string): any; + dxRangeSlider(options: string, ...params: any[]): any; + dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxFileUploader(): JQuery; + dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; + dxFileUploader(options: string): any; + dxFileUploader(options: string, ...params: any[]): any; + dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; + dxValidator(): JQuery; + dxValidator(options: "instance"): DevExpress.ui.dxValidator; + dxValidator(options: string): any; + dxValidator(options: string, ...params: any[]): any; + dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; + dxValidationGroup(): JQuery; + dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; + dxValidationGroup(options: string): any; + dxValidationGroup(options: string, ...params: any[]): any; + dxValidationSummary(): JQuery; + dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; + dxValidationSummary(options: string): any; + dxValidationSummary(options: string, ...params: any[]): any; + dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; + dxTooltip(): JQuery; + dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; + dxTooltip(options: string): any; + dxTooltip(options: string, ...params: any[]): any; + dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; + dxResizable(): JQuery; + dxResizable(options: "instance"): DevExpress.ui.dxResizable; + dxResizable(options: string): any; + dxResizable(options: string, ...params: any[]): any; + dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; + dxDropDownList(): JQuery; + dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; + dxDropDownList(options: string): any; + dxDropDownList(options: string, ...params: any[]): any; + dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; + dxToolbar(): JQuery; + dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; + dxToolbar(options: string): any; + dxToolbar(options: string, ...params: any[]): any; + dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; + dxToast(): JQuery; + dxToast(options: "instance"): DevExpress.ui.dxToast; + dxToast(options: string): any; + dxToast(options: string, ...params: any[]): any; + dxToast(options: DevExpress.ui.dxToastOptions): JQuery; + dxTextEditor(): JQuery; + dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; + dxTextEditor(options: string): any; + dxTextEditor(options: string, ...params: any[]): any; + dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; + dxTextBox(): JQuery; + dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; + dxTextBox(options: string): any; + dxTextBox(options: string, ...params: any[]): any; + dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; + dxTextArea(): JQuery; + dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; + dxTextArea(options: string): any; + dxTextArea(options: string, ...params: any[]): any; + dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTabs(): JQuery; + dxTabs(options: "instance"): DevExpress.ui.dxTabs; + dxTabs(options: string): any; + dxTabs(options: string, ...params: any[]): any; + dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; + dxTabPanel(): JQuery; + dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; + dxTabPanel(options: string): any; + dxTabPanel(options: string, ...params: any[]): any; + dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; + dxSelectBox(): JQuery; + dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; + dxSelectBox(options: string): any; + dxSelectBox(options: string, ...params: any[]): any; + dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; +} + +declare module DevExpress.ui { + export interface dxTileViewOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the height of the base tile view item. */ + baseItemHeight?: number; + /** Specifies the width of the base tile view item. */ + baseItemWidth?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the distance in pixels between adjacent tiles. */ + itemMargin?: number; + /** A Boolean value specifying whether or not to display a scrollbar. */ + showScrollbar?: boolean; + } + /** A widget displaying several blocks of data as tiles. */ + export class dxTileView extends CollectionWidget { + constructor(element: JQuery, options?: dxTileViewOptions); + constructor(element: Element, options?: dxTileViewOptions); + /** Returns the current scroll position of the widget content. */ + scrollPosition(): number; + } + export interface dxSwitchOptions extends EditorOptions { + /** Text displayed when the widget is in a disabled state. */ + offText?: string; + /** Text displayed when the widget is in an enabled state. */ + onText?: string; + /** A Boolean value specifying whether the current switch state is "On" or "Off". */ + value?: boolean; + } + /** A switch widget. */ + export class dxSwitch extends Editor { + constructor(element: JQuery, options?: dxSwitchOptions); + constructor(element: Element, options?: dxSwitchOptions); + } + export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies whether or not the menu panel is visible. */ + menuVisible?: boolean; + /** Specifies whether or not the menu is shown when a user swipes the widget content. */ + swipeEnabled?: boolean; + /** A template to be used for rendering menu panel content. */ + menuTemplate?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal a custom menu. */ + export class dxSlideOutView extends Widget { + constructor(element: JQuery, options?: dxSlideOutViewOptions); + constructor(element: Element, options?: dxSlideOutViewOptions); + /** Returns an HTML element of the widget menu block. */ + menuContent(): JQuery; + /** Returns an HTML element of the widget content block. */ + content(): JQuery; + /** Displays the widget's menu block. */ + showMenu(): JQueryPromise; + /** Hides the widget's menu block. */ + hideMenu(): JQueryPromise; + /** Toggles the visibility of the widget's menu block. */ + toggleMenuVisibility(): JQueryPromise; + } + export interface dxSlideOutOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not to display a grouped menu. */ + menuGrouped?: boolean; + menuGroupRender?: any; + /** The name of the template used to display a group header. */ + menuGroupTemplate?: any; + menuItemRender?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** A handler for the menuGroupRendered event. */ + onMenuGroupRendered?: Function; + /** A handler for the menuItemRendered event. */ + onMenuItemRendered?: Function; + /** Specifies whether or not the slide-out menu is displayed. */ + menuVisible?: boolean; + /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal an item list. */ + export class dxSlideOut extends CollectionWidget { + constructor(element: JQuery, options?: dxSlideOutOptions); + constructor(element: Element, options?: dxSlideOutOptions); + /** Hides the widget's slide-out menu. */ + hideMenu(): JQueryPromise; + /** Displays the widget's slide-out menu. */ + showMenu(): JQueryPromise; + /** Toggles the visibility of the widget's slide-out menu. */ + toggleMenuVisibility(showing: boolean): JQueryPromise; + } + export interface dxPivotOptions extends CollectionWidgetOptions { + /** The index of the currently active pivot item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ + export class dxPivot extends CollectionWidget { + constructor(element: JQuery, options?: dxPivotOptions); + constructor(element: Element, options?: dxPivotOptions); + } + export interface dxPanoramaOptions extends CollectionWidgetOptions { + /** An object exposing options for setting a background image for the panorama. */ + backgroundImage?: { + /** Specifies the height of the panorama's background image. */ + height?: number; + /** Specifies the URL of the image that is used as the panorama's background image. */ + url?: string; + /** Specifies the width of the panorama's background image. */ + width?: number; + }; + /** The index of the currently active panorama item. */ + selectedIndex?: number; + /** Specifies the widget content title. */ + title?: string; + } + /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ + export class dxPanorama extends CollectionWidget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + } + export interface dxDropDownMenuOptions extends WidgetOptions { + /** A handler for the buttonClick event. */ + onButtonClick?: any; + buttonClickAction?: any; + /** The name of the icon to be displayed by the DropDownMenu button. */ + buttonIcon?: string; + buttonIconSrc?: string; + /** The text displayed in the DropDownMenu button. */ + buttonText?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + itemClickAction?: any; + itemRender?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + usePopover?: boolean; + /** The width of the menu popup in pixels. */ + popupWidth?: any; + /** The height of the menu popup in pixels. */ + popupHeight?: any; + /** Specifies whether or not the drop-down menu is displayed. */ + opened?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + } + /** A drop-down menu widget. */ + export class dxDropDownMenu extends Widget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** This section lists the data source fields that are used in a default template for drop-down menu items. */ + /** Opens the drop-down menu. */ + open(): void; + /** Closes the drop-down menu. */ + close(): void; + } + export interface dxActionSheetOptions extends CollectionWidgetOptions { + cancelClickAction?: any; + /** A handler for the cancelClick event. */ + onCancelClick?: any; + /** The text displayed in the button that closes the action sheet. */ + cancelText?: string; + /** Specifies whether or not to display the Cancel button in action sheet. */ + showCancelButton?: boolean; + /** A Boolean value specifying whether or not the title of the action sheet is visible. */ + showTitle?: boolean; + /** Specifies the element the action sheet popover points at. */ + target?: any; + /** The title of the action sheet. */ + title?: string; + /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + usePopover?: boolean; + /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + visible?: boolean; + } + /** A widget consisting of a set of choices related to a certain task. */ + export class dxActionSheet extends CollectionWidget { + constructor(element: JQuery, options?: dxActionSheetOptions); + constructor(element: Element, options?: dxActionSheetOptions); + /** Hides the widget. */ + hide(): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ + toggle(showing: boolean): JQueryPromise; + } +} +interface JQuery { + dxTileView(): JQuery; + dxTileView(options: "instance"): DevExpress.ui.dxTileView; + dxTileView(options: string): any; + dxTileView(options: string, ...params: any[]): any; + dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; + dxSwitch(): JQuery; + dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; + dxSwitch(options: string): any; + dxSwitch(options: string, ...params: any[]): any; + dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; + dxSlideOut(): JQuery; + dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; + dxSlideOut(options: string): any; + dxSlideOut(options: string, ...params: any[]): any; + dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; + dxPivot(): JQuery; + dxPivot(options: "instance"): DevExpress.ui.dxPivot; + dxPivot(options: string): any; + dxPivot(options: string, ...params: any[]): any; + dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; + dxPanorama(): JQuery; + dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; + dxPanorama(options: string): any; + dxPanorama(options: string, ...params: any[]): any; + dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; + dxActionSheet(): JQuery; + dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; + dxActionSheet(options: string): any; + dxActionSheet(options: string, ...params: any[]): any; + dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(): JQuery; + dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; + dxDropDownMenu(options: string): any; + dxDropDownMenu(options: string, ...params: any[]): any; + dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; +} +declare module DevExpress.data { + export interface XmlaStoreOptions { + /** The HTTP address to an XMLA OLAP server. */ + url?: string; + /** The name of the database associated with the Store. */ + catalog?: string; + /** The cube name. */ + cube?: string; + beforeSend?: (request: Object) => void; + } + /** A Store that provides access to an OLAP cube using the XMLA standard. */ + export class XmlaStore { + constructor(options: XmlaStoreOptions); + } + export interface PivotGridField { + index?: number; + /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ + visible?: boolean; + /** Name of the data source field containing data for the pivot grid field. */ + dataField?: string; + /** A caption that will be displayed in the pivot grid's field chooser to identify the field. */ + caption?: string; + /** Specifies a type of field values. */ + dataType?: string; + /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ + groupInterval?: any; + /** Specifies how to aggregate field data. Cannot be used for th XmlaStore store type. */ + summaryType?: string; + /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ + calculateCustomSummary?: (options: { + summaryProcess?: string; + value?: any; + totalValue?: any; + }) => void; + /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ + selector?: (data: Object) => any; + /** Type of the area where the field is located. */ + area?: string; + /** Index among the other fields displayed within the same area. */ + areaIndex?: number; + /** The name of the folder in which the field is located. */ + displayFolder?: string; + /** The name of the group to which the field belongs. */ + groupName?: string; + /** The index of the field within a group. */ + groupIndex?: number; + /** Specifies the initial sort order of field values. */ + sortOrder?: string; + /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ + sortBy?: string; + /** Specifies the data field against which the header items of this field should be sorted. */ + sortBySummaryField?: string; + /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ + sortBySummaryPath?: Array; + /** The filter values for the current field. */ + filterValues?: Array; + /** The filter type for the current field. */ + filterType?: string; + /** Indicates whether all header items of the field's header level are expanded. */ + expanded?: boolean; + /** Specifies whether the field should be treated as a Data Field. */ + isMeasure?: boolean; + /** Specifies a display format for field values. */ + format?: string; + /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies a precision for formatted field values. */ + precision?: number; + /** Specifies how to sort the header items. */ + sortingMethod?: (a: Object, b: Object) => number; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies the absolute width of the field in the pivot grid. */ + width?: number; + } + export interface PivotGridDataSourceOptions { + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ + retrieveFields?: boolean; + /** Specifies data filtering conditions. */ + filter?: Object; + /** An array of pivot grid fields. */ + fields?: Array; + /** Indicates whether or not the local sorting of the XMLA data should be performed. */ + localSorting?: boolean; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Object) => void; + /** A handler for the fieldsPrepared event. */ + onFieldsPrepared?: (e?: Array) => void; + } + /** An object that provides access to data for the dxPivotGrid widget. */ + export class PivotGridDataSource implements EventsMixin { + constructor(options?: PivotGridDataSource); + /** Starts loading data. */ + load(): JQueryPromise; + /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ + isLoading(): boolean; + /** Gets data displayed in a PivotGrid. */ + getData(): Object; + /** Gets all fields within a specified area. */ + getAreaFields(area: string, collectGroups: boolean): Array; + /** Gets all fields from the data source. */ + fields(): Array; + /** Sets the fields option. */ + fields(fields: Array): void; + /** Gets current options of a specified field. */ + field(id: any): PivotGridField; + /** Sets one or more options of a specified field. */ + field(id: any, field: PivotGridField): void; + /** Collapses a specified header item. */ + collapseHeaderItem(area: string, path: Array): void; + /** Expands a specified header item. */ + expandHeaderItem(area: string, path: Array): void; + /** Expands all header items of a field. */ + expandAll(id: any): void; + /** Collapses all header items of a field. */ + collapseAll(id: any): void; + /** Disposes of all resources associated with this PivotGridDataSource. */ + dispose(): void; + on(eventName: string, eventHandler: Function): PivotGridDataSource; + on(events: { [eventName: string]: Function; }): PivotGridDataSource; + off(eventName: string): PivotGridDataSource; + off(eventName: string, eventHandler: Function): PivotGridDataSource; + } +} +declare module DevExpress.ui { + export interface dxSchedulerOptions extends WidgetOptions { + /** Specifies a date displayed on the current scheduler view by default. */ + currentDate?: Date; + /** The earliest date the widget allows you to select. */ + min?: Date; + /** The latest date the widget allows you to select. */ + max?: Date; + /** Specifies the view used in the scheduler by default. */ + currentView?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The template to be used for rendering appointments. */ + appointmentTemplate?: any; + /** Lists the views to be available within the scheduler's View Selector. */ + views?: Array; + /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ + groups?: Array; + /** Specifies a start hour in the scheduler view's time interval. */ + startDayHour?: number; + /** Specifies an end hour in the scheduler view's time interval. */ + endDayHour?: number; + /** Specifies whether the scheduler data can be edited at runtime. */ + editing?: boolean; + /** Specifies an array of resources available in the scheduler. */ + resources?: Array<{ + /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ + allowMultiple?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + mainColor?: boolean; + /** A data source used to fetch resources to be available in the scheduler. */ + dataSource?: any; + /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ + displayExpr?: any; + /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ + valueExpr?: any; + /** The name of the appointment object field that specifies a resource of this kind. */ + field?: string; + /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ + label?: string; + }>; + /** A handler for the AppointmentAdding event. */ + onAppointmentAdding?: Function; + /** A handler for the appointmentAdded event. */ + onAppointmentAdded?: Function; + /** A handler for the AppointmentUpdating event. */ + onAppointmentUpdating?: Function; + /** A handler for the appointmentUpdated event. */ + onAppointmentUpdated?: Function; + /** A handler for the AppointmentDeleting event. */ + onAppointmentDeleting?: Function; + /** A handler for the appointmentDeleted event. */ + onAppointmentDeleted?: Function; + /** A handler for the appointmentRendered event. */ + onAppointmentRendered?: Function; + } + /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ + export class dxScheduler extends Widget { + constructor(element: JQuery, options?: dxSchedulerOptions); + constructor(element: Element, options?: dxSchedulerOptions); + /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ + addAppointment(appointment: Object): void; + /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ + updateAppointment(target: Object, appointment: Object): void; + /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ + deleteAppointment(appointment: Object): void; + /** Scrolls the scheduler work space to the specified time. */ + scrollToTime(hours: number, minutes: number): void; + } + export interface dxColorBoxOptions extends dxDropDownEditorOptions { + /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ + applyButtonText?: string; + applyValueMode?: string; + /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ + cancelButtonText?: string; + /** Specifies whether or not the widget value includes the alpha channel component. */ + editAlphaChannel?: boolean; + /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ + keyStep?: number; + } + /** A widget used to specify a color value. */ + export class dxColorBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxColorBoxOptions); + constructor(element: Element, options?: dxColorBoxOptions); + } + export interface dxColorPickerOptions extends dxColorBoxOptions { } + /** + * A widget used to specify a color value. + * @deprecated Use the dxColorBox widget instead + */ + export class dxColorPicker extends dxColorBox { + constructor(element: JQuery, options?: dxColorPickerOptions); + constructor(element: Element, options?: dxColorPickerOptions); + } + export interface dxTreeViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate item collapsing and expanding. */ + animationEnabled?: boolean; + /** Specifies whether a nested or plain array is used as a data source. */ + dataStructure?: string; + /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ + expandAllEnabled?: boolean; + /** + * An array of currently expanded item objects. + * @deprecated Use item.expanded field instead + */ + expandedItems?: Array; + /** Specifies whether or not a check box is displayed at each tree view item. */ + showCheckBoxes?: boolean; + /** Specifies whether or not to select nodes recursively. */ + selectNodesRecursive?: boolean; + /** Specifies whether the "Select All" check box is displayed over the tree view. */ + selectAllEnabled?: boolean; + /** Specifies the text displayed at the "Select All" check box. */ + selectAllText?: string; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node is expanded. */ + expandedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field that holds the key of the parent item. */ + parentIdExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node is disabled. */ + disabledExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ + hasItemsExpr?: any; + /** Specifies if the virtual mode is enabled. */ + virtualModeEnabled?: boolean; + /** Specifies the parent ID value of the root item. */ + rootValue?: any; + /** A string value specifying available scrolling directions. */ + scrollDirection?: string; + /** A handler for the itemSelected event. */ + onItemSelected?: Function; + /** A handler for the itemExpanded event. */ + onItemExpanded?: Function; + /** A handler for the itemCollapsed event. */ + onItemCollapsed?: Function; + onItemClick?: Function; + onItemContextMenu?: Function; + onItemRendered?: Function; + onItemHold?: Function; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; + } + /** A widget displaying specified data items as a tree. */ + export class dxTreeView extends CollectionWidget { + constructor(element: JQuery, options?: dxTreeViewOptions); + constructor(element: Element, options?: dxTreeViewOptions); + /** Updates the tree view scrollbars according to the current size of the widget content. */ + updateDimensions(): JQueryPromise; + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + /** Expands the specified item. */ + expandItem(itemElement: any): void; + /** Collapses the specified item. */ + collapseItem(itemElement: any): void; + /** Returns all nodes of the tree view. */ + getNodes(): Array; + /** Selects all widget items. */ + selectAll(): void; + /** Unselects all widget items. */ + unselectAll(): void; + } + export interface dxMenuBaseOptions extends CollectionWidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the name of the CSS class associated with the menu. */ + cssClass?: string; + /** Holds an array of menu items. */ + items?: Array; + /** Specifies whether or not an item becomes selected if an end-user clicks it. */ + selectionByClick?: boolean; + /** Specifies the selection mode supported by the menu. */ + selectionMode?: string; + /** Specifies options of submenu showing and hiding. */ + showSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu show and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + } + export class dxMenuBase extends CollectionWidget { + constructor(element: JQuery, options?: dxMenuBaseOptions); + constructor(element: Element, options?: dxMenuBaseOptions); + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + } + export interface dxMenuOptions extends dxMenuBaseOptions { + /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ + hideSubmenuOnMouseLeave?: boolean; + /** Specifies whether the menu has horizontal or vertical orientation. */ + orientation?: string; + /** Specifies options for showing and hiding the first level submenu. */ + showFirstSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu showing and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** Specifies the direction at which the submenus are displayed. */ + submenuDirection?: string; + /** A handler for the submenuHidden event. */ + onSubmenuHidden?: Function; + submenuHiddenAction?: Function; + /** A handler for the submenuHiding event. */ + onSubmenuHiding?: Function; + submenuHidingAction?: Function; + /** A handler for the submenuShowing event. */ + onSubmenuShowing?: Function; + submenuShowingAction?: Function; + /** A handler for the submenuShown event. */ + onSubmenuShown?: Function; + submenuShownAction?: Function; + } + /** A menu widget. */ + export class dxMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxMenuOptions); + constructor(element: Element, options?: dxMenuOptions); + } + export interface dxContextMenuOptions extends dxMenuBaseOptions { + /** Holds an object that specifies options of alternative menu invocation. */ + alternativeInvocationMode?: { + /** Specifies whether or not the standard context menu invocation (on a right mouse click or on a long tap) is disabled. */ + enabled?: Boolean; + /** Specifies the element used to invoke the context menu. */ + invokingElement?: any; + }; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** A handler for the positioning event. */ + onPositioning?: Function; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the direction at which submenus are displayed. */ + submenuDirection?: string; + /** The target element associated with a popover. */ + target?: any; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + } + /** A context menu widget. */ + export class dxContextMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxContextMenuOptions); + constructor(element: Element, options?: dxContextMenuOptions); + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Hides the widget. */ + hide(): JQueryPromise; + } + export interface dxRemoteOperations { + /** Specifies whether or not filtering must be performed on the server side. */ + filtering?: boolean; + /** Specifies whether or not paging must be performed on the server side. */ + paging?: boolean; + /** Specifies whether or not sorting must be performed on the server side. */ + sorting?: boolean; + } + export interface dxDataGridColumn { + /** Specifies the content alignment within column cells. */ + alignment?: string; + /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ + allowEditing?: boolean; + /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ + allowFiltering?: boolean; + /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ + allowFixing?: boolean; + /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ + allowSearch?: boolean; + /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ + allowGrouping?: boolean; + /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ + allowHiding?: boolean; + /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ + allowReordering?: boolean; + /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ + allowResizing?: boolean; + /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ + allowSorting?: boolean; + /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ + autoExpandGroup?: boolean; + /** Specifies a callback function that returns a value to be displayed in a column cell. */ + calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function that defines filters for customary calculated grid cells. */ + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string) => Array; + /** Specifies a caption for a column. */ + caption?: string; + /** Specifies a custom template for grid column cells. */ + cellTemplate?: any; + /** Specifies a CSS class to be applied to a column. */ + cssClass?: string; + /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ + calculateGroupValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ + calculateSortValue?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies the field of a data source that provides data for a column. */ + dataField?: string; + /** Specifies the required type of column values. */ + dataType?: string; + /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ + editCellTemplate?: any; + /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ + encodeHtml?: boolean; + /** In a boolean column, replaces all false items with a specified text. */ + falseText?: string; + /** Specifies the set of available filter operations. */ + filterOperations?: Array; + /** Specifies a filter value for a column. */ + filterValue?: any; + /** Specifies initial filter values for the column's header filter. */ + filterValues?: Array; + /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ + filterType?: string; + /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ + fixed?: boolean; + /** Specifies the grid edge to which the column is anchored. */ + fixedPosition?: string; + /** Specifies a format for the values displayed in a column. */ + format?: string; + /** Specifies a custom template for the group cell of a grid column. */ + groupCellTemplate?: any; + /** Specifies the index of a column when grid records are grouped by the values of this column. */ + groupIndex?: number; + /** Specifies a custom template for the header of a grid column. */ + headerCellTemplate?: any; + /** Specifies options of a lookup column. */ + lookup?: { + /** Specifies whether or not a user can nullify values of a lookup column. */ + allowClearing?: boolean; + /** Specifies the data source providing data for a lookup column. */ + dataSource?: any; + /** Specifies the expression defining the data source field whose values must be displayed. */ + displayExpr?: any; + /** Specifies the expression defining the data source field whose values must be replaced. */ + valueExpr?: string; + }; + /** Specifies a precision for formatted values displayed in a column. */ + precision?: number; + /** Specifies a filter operation applied to a column. */ + selectedFilterOperation?: string; + /** Specifies whether or not the column displays its values by using editors. */ + showEditorAlways?: boolean; + /** Specifies whether or not to display the column when grid records are grouped by it. */ + showWhenGrouped?: boolean; + /** Specifies the index of a column when grid records are sorted by the values of this column. */ + sortIndex?: number; + /** Specifies the initial sort order of column values. */ + sortOrder?: string; + /** In a boolean column, replaces all true items with a specified text. */ + trueText?: string; + /** Specifies whether a column is visible or not. */ + visible?: boolean; + /** Specifies the sequence number of the column in the grid. */ + visibleIndex?: number; + /** Specifies a column width in pixels or percentages. */ + width?: any; + /** Specifies an array of validation rules to be checked when updating column cell values. */ + validationRules?: Array; + /** Specifies whether or not to display the header of a hidden column in the column chooser. */ + showInColumnChooser?: boolean; + /** Specifies the identifier of the column. */ + name?: string; + } + export interface dxDataGridOptions extends WidgetOptions { + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** Indicates whether to show the error row for the grid. */ + errorRowEnabled?: boolean; + /** A handler for the rowValidating event. */ + onRowValidating?: (e: Object) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + initNewRow?: (e: { data: Object }) => void; + /** A handler for the initNewRow event. */ + onInitNewRow?: (e: { data: Object }) => void; + rowInserted?: (e: { data: Object; key: any }) => void; + /** A handler for the rowInserted event. */ + onRowInserted?: (e: { data: Object; key: any }) => void; + rowInserting?: (e: { data: Object; cancel: boolean }) => void; + /** A handler for the rowInserting event. */ + onRowInserting?: (e: { data: Object; cancel: boolean }) => void; + rowRemoved?: (e: { data: Object; key: any }) => void; + /** A handler for the rowRemoved event. */ + onRowRemoved?: (e: { data: Object; key: any }) => void; + rowRemoving?: (e: { data: Object; key: any; cancel: boolean }) => void; + /** A handler for the rowRemoving event. */ + onRowRemoving?: (e: { data: Object; key: any; cancel: boolean }) => void; + rowUpdated?: (e: { data: Object; key: any }) => void; + /** A handler for the rowUpdated event. */ + onRowUpdated?: (e: { data: Object; key: any }) => void; + rowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: boolean }) => void; + /** A handler for the rowUpdating event. */ + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: boolean }) => void; + /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ + cellHintEnabled?: boolean; + /** Specifies whether or not grid columns can be reordered by a user. */ + allowColumnReordering?: boolean; + /** Specifies whether or not grid columns can be resized by a user. */ + allowColumnResizing?: boolean; + cellClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + cellHoverChanged?: (e: Object) => void; + /** A handler for the cellHoverChanged event. */ + onCellHoverChanged?: (e: Object) => void; + cellPrepared?: (e: Object) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: Object) => void; + /** Specifies whether or not the width of grid columns depends on column content. */ + columnAutoWidth?: boolean; + /** Specifies the options of a column chooser. */ + columnChooser?: { + /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether a user can invoke the column chooser or not. */ + enabled?: boolean; + /** Specifies the height of the column chooser panel. */ + height?: number; + /** Specifies text displayed in the title of the column chooser panel. */ + title?: string; + /** Specifies the width of the column chooser panel. */ + width?: number; + }; + /** Specifies options for column fixing. */ + columnFixing?: { + /** Indicates if column fixing is enabled. */ + enabled?: boolean; + /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ + texts?: { + /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ + fix?: string; + /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ + unfix?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ + leftPosition?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ + rightPosition?: string; + }; + }; + /** Specifies options for filtering using a column header filter. */ + headerFilter?: { + /** Indicates whether or not the column header filter button is visible. */ + visible?: boolean; + /** Specifies the height of the dropdown menu invoked when using a column header filter. */ + height?: number; + /** Specifies the width of the dropdown menu invoked when using a column header filter. */ + width?: number; + /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ + texts?: { + /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ + emptyValue?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ + ok?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ + cancel?: string; + } + }; + /** An array of grid columns. */ + columns?: Array; + onContentReady?: Function; + contentReadyAction?: Function; + /** Specifies a function that customizes grid columns after they are created. */ + customizeColumns?: (columns: Array) => void; + dataErrorOccurred?: (errorObject: Error) => void; + /** Specifies a data source for the grid. */ + dataSource?: any; + editingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + /** A handler for the editingStart event. */ + onEditingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + editorPrepared?: (e: Object) => void; + /** A handler for the editorPrepared event. */ + onEditorPrepared?: (e: Object) => void; + editorPreparing?: (e: Object) => void; + /** A handler for the editorPreparing event. */ + onEditorPreparing?: (e: Object) => void; + /** Contains options that specify how grid content can be changed. */ + editing?: { + /** Specifies whether or not grid records can be edited at runtime. */ + editEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + editMode?: string; + /** Specifies whether or not new records can be inserted into a grid. */ + insertEnabled?: boolean; + /** Specifies whether or not records can be deleted from a grid. */ + removeEnabled?: boolean; + /** Contains options that specify texts for editing-related grid controls. */ + texts?: { + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the editMode option is set to batch. */ + saveAllChanges?: string; + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ + cancelRowChanges?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the editMode option is set to batch. */ + cancelAllChanges?: string; + /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteMessage?: string; + /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteTitle?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the removeEnabled option is set to true. */ + deleteRow?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the insertEnabled option is true. */ + addRow?: string; + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ + editRow?: string; + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ + saveRowChanges?: string; + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the removeEnabled option is set to true. */ + undeleteRow?: string; + }; + }; + /** Specifies filter row options. */ + filterRow?: { + /** Specifies when to apply a filter. */ + applyFilter?: string; + /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ + applyFilterText?: string; + /** Specifies descriptions for filter operations. */ + operationDescriptions?: { + "=": string; + "<>": string; + "<": string; + "<=": string; + ">": string; + ">=": string; + "startswith": string; + "contains": string; + "notcontains": string; + "endswith": string; + }; + /** Specifies text for the reset operation in a filter list. */ + resetOperationText?: string; + /** Specifies text for the operation of clearing the applied filter when a select box is used. */ + showAllText?: string; + /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ + showOperationChooser?: boolean; + /** Specifies whether the filter row is visible or not. */ + visible?: boolean; + }; + /** Specifies the behavior of grouped grid records. */ + grouping?: { + /** Specifies whether the user can collapse grouped records in a grid or not. */ + allowCollapsing?: boolean; + /** Specifies whether groups appear expanded or not. */ + autoExpandAll?: boolean; + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + }; + /** Specifies options that configure the group panel. */ + groupPanel?: { + /** Specifies whether columns can be dragged onto or from the group panel. */ + allowColumnDragging?: boolean; + /** Specifies text displayed by the group panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether the group panel is visible or not. */ + visible?: boolean; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Specifies whether to show the load panel or not. */ + enabled?: boolean; + /** Specifies the height of the load panel in pixels. */ + height?: number; + /** Specifies a URL pointing to an image to be used as a loading indicator. */ + indicatorSrc?: string; + /** Specifies whether or not a loading indicator must be displayed on the load panel. */ + showIndicator?: boolean; + /** Specifies whether or not the pane of the load panel must be displayed. */ + showPane?: boolean; + /** Specifies text displayed by the load panel. */ + text?: string; + /** Specifies the width of the load panel in pixels. */ + width?: number; + }; + /** Specifies text displayed when a grid does not contain any records. */ + noDataText?: string; + /** Specifies the options of a grid pager. */ + pager?: { + /** Specifies the page sizes that can be selected at runtime. */ + allowedPageSizes?: any; + /** Specifies whether to show the page size selector or not. */ + showPageSizeSelector?: boolean; + /** Specifies whether to show the pager or not. */ + visible?: any; + /** Specifies the text accompanying the page navigator. */ + infoText?: string; + /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ + showInfo?: boolean; + /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ + showNavigationButtons?: boolean; + }; + /** Specifies paging options. */ + paging?: { + /** Specifies whether dxDataGrid loads data page by page or all at once. */ + enabled?: boolean; + /** Specifies the grid page that should be displayed by default. */ + pageIndex?: number; + /** Specifies the size of grid pages. */ + pageSize?: number; + }; + /** Specifies whether or not grid rows must be shaded in a different way. */ + rowAlternationEnabled?: boolean; + rowClick?: any; + /** A handler for the rowClick event. */ + onRowClick?: any; + rowPrepared?: (e: Object) => void; + /** A handler for the rowPrepared event. */ + onRowPrepared?: (e: Object) => void; + /** Specifies a custom template for grid rows. */ + rowTemplate?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ + preloadEnabled?: boolean; + }; + /** Specifies options of the search panel. */ + searchPanel?: { + /** Specifies whether or not search strings in the located grid records should be highlighted. */ + highlightSearchText?: boolean; + /** Specifies text displayed by the search panel when no search string was typed. */ + placeholder?: string; + /** Specifies whether the search panel is visible or not. */ + visible?: boolean; + /** Specifies the width of the search panel in pixels. */ + width?: number; + /** Sets a search string for the search panel. */ + text?: string; + }; + /** Specifies the operations that must be performed on the server side. */ + remoteOperations?: any; + /** Allows you to sort groups according to the values of group summary items. */ + sortByGroupSummaryInfo?: Array<{ + /** Specifies the group summary item whose values must be used to sort groups. */ + summaryItem?: string; + /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ + groupColumn?: string; + /** Specifies the sort order of group summary item values. */ + sortOrder?: string; + }>; + /** Allows you to build a master-detail interface in the grid. */ + masterDetail?: { + /** Enables an end-user to expand/collapse detail sections. */ + enabled?: boolean; + /** Specifies whether detail sections appear expanded or collapsed. */ + autoExpandAll?: boolean; + /** Specifies the template for detail sections. */ + template?: any; + }; + /** Specifies options for exporting grid data. */ + export?: { + /** Indicates if the export feature is enabled in the grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ + excelFilterEnabled?: boolean; + /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ + excelWrapTextEnabled?: boolean; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + /** Indicates whether to allow end users to export not only the data displayed in the grid, but the selected rows only. */ + allowExportSelectedData?: boolean; + /** Contains options that specify texts for the export-related commands and hints. */ + texts?: { + /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ + exportTo?: string; + /** Specifies text for the Export button when this button exports to the XSLX format. */ + exportToExcel?: string; + /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ + excelFormat?: string; + /** Specifies text for the option in the Export dropdown menu that allows you to choose whether to export all the grid data or the selected rows only. */ + selectedRows?: string; + } + }; + /** Specifies the keys of the records that must appear selected initially. */ + selectedRowKeys?: Array; + /** Specifies options of runtime selection. */ + selection?: { + /** Specifies whether the user can select all grid records at once. */ + allowSelectAll?: boolean; + /** Specifies the selection mode. */ + mode?: string; + }; + selectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the dataErrorOccured event. */ + onDataErrorOccurred?: (e: { error: Error }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + format: string; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A handler for the keyDown event. */ + onKeyDown?: (e: Object) => void; + /** A handler for the rowExpanding event. */ + onRowExpanding?: (e: Object) => void; + /** A handler for the rowExpanded event. */ + onRowExpanded?: (e: Object) => void; + /** A handler for the rowCollapsing event. */ + onRowCollapsing?: (e: Object) => void; + /** A handler for the rowCollapsed event. */ + onRowCollapsed?: (e: Object) => void; + /** Specifies whether column headers are visible or not. */ + showColumnHeaders?: boolean; + /** Specifies whether or not vertical lines separating one grid column from another are visible. */ + showColumnLines?: boolean; + /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ + showRowLines?: boolean; + /** Specifies options of runtime sorting. */ + sorting?: { + /** Specifies text for the context menu item that sets an ascending sort order in a column. */ + ascendingText?: string; + /** Specifies text for the context menu item that resets sorting settings for a column. */ + clearText?: string; + /** Specifies text for the context menu item that sets a descending sort order in a column. */ + descendingText?: string; + /** Specifies the runtime sorting mode. */ + mode?: string; + }; + /** Specifies options of state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + /** Specifies the options of the grid summary. */ + summary?: { + /** Contains options that specify text patterns for summary items. */ + texts?: { + /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ + sum?: string; + /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ + sumOtherColumn?: string; + /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ + min?: string; + /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ + minOtherColumn?: string; + /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ + max?: string; + /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ + maxOtherColumn?: string; + /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ + avg?: string; + /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ + avgOtherColumn?: string; + /** Specifies a pattern for the 'count' summary items. */ + count?: string; + }; + /** Specifies items of the group summary. */ + groupItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the column that provides data for a group summary item. */ + column?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies whether or not a summary item must be displayed in the group footer. */ + showInGroupFooter?: boolean; + /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ + alignByColumn?: boolean; + /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + }>; + /** Specifies items of the total summary. */ + totalItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the alignment of a summary item. */ + alignment?: string; + /** Specifies the column that provides data for a summary item. */ + column?: string; + /** Specifies a CSS class to be applied to a summary item. */ + cssClass?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies the column that must hold the summary item. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + }>; + /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ + calculateCustomSummary?: (options: { + component: dxDataGrid; + name?: string; + value: any; + totalValue: any; + summaryProcess: string + }) => void; + }; + /** Specifies whether text that does not fit into a column should be wrapped. */ + wordWrapEnabled?: boolean; + } + /** A data grid widget. */ + export class dxDataGrid extends Widget { + constructor(element: JQuery, options?: dxDataGridOptions); + constructor(element: Element, options?: dxDataGridOptions); + /** Ungroups grid records. */ + clearGrouping(): void; + /** Clears sorting settings of all grid columns at once. */ + clearSorting(): void; + /** Allows you to obtain a cell by its row index and the data field of its column. */ + getCellElement(rowIndex: number, dataField: string): any; + /** Allows you to obtain a cell by its row index and the visible index of its column. */ + getCellElement(rowIndex: number, visibleColumnIndex: number): any; + /** Returns the current state of the grid. */ + state(): Object; + /** Sets the grid state. */ + state(state: Object): void; + /** Allows you to obtain the row index by a data key. */ + getRowIndexByKey(key: any): number; + /** Allows you to obtain the data key by a row index. */ + getKeyByRowIndex(rowIndex: number): any; + /** Adds a new column to a grid. */ + addColumn(columnOptions: dxDataGridColumn): void; + /** Displays the load panel. */ + beginCustomLoading(messageText: string): void; + /** Discards changes made in a grid. */ + cancelEditData(): void; + /** Clears all the filters of a specific type applied to grid records. */ + clearFilter(): void; + /** Deselects all grid records. */ + clearSelection(): void; + /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ + closeEditCell(): void; + /** Collapses groups or master rows in a grid. */ + collapseAll(groupIndex?: number): void; + /** Returns the number of data columns in a grid. */ + columnCount(): number; + /** Returns the value of a specific column option. */ + columnOption(id: any, optionName: string): any; + /** Sets an option of a specific column. */ + columnOption(id: any, optionName: string, optionValue: any): void; + /** Returns the options of a column by an identifier. */ + columnOption(id: any): Object; + /** Sets several options of a column at once. */ + columnOption(id: any, options: Object): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, columnIndex: number): void; + /** Sets a specific row into the editing state. */ + editRow(rowIndex: number): void; + /** Hides the load panel. */ + endCustomLoading(): void; + /** Expands groups or master rows in a grid. */ + expandAll(groupIndex: number): void; + /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ + isRowExpanded(key: any): boolean; + /** Allows you to expand a specific group or master row by its key. */ + expandRow(key: any): void; + /** Allows you to collapse a specific group or master row by its key. */ + collapseRow(key: any): void; + /** Applies a filter to the grid's data source. */ + filter(filterExpr?: any): void; + /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ + filter(): any; + /** Returns a filter expression applied to the grid using all possible scenarious. */ + getCombinedFilter(): any; + /** Gets the keys of currently selected grid records. */ + getSelectedRowKeys(): Array; + /** Gets the data objects of currently selected grid records. */ + getSelectedRowsData(): Array; + /** Hides the column chooser panel. */ + hideColumnChooser(): void; + /** Adds a new data row to a grid. */ + insertRow(): void; + /** Returns the key corresponding to the passed data object. */ + keyOf(obj: Object): any; + /** Switches a grid to a specified page. */ + pageIndex(newIndex: number): void; + /** Gets the index of the current page. */ + pageIndex(): number; + /** Sets the page size. */ + pageSize(value: number): void; + /** Gets the current page size. */ + pageSize(): number; + /** Refreshes grid data. */ + refresh(): void; + /** Removes a specific row from a grid. */ + removeRow(rowIndex: number): void; + /** Saves changes made in a grid. */ + saveEditData(): void; + /** Searches grid records by a search string. */ + searchByText(text: string): void; + /** Selects all grid records. */ + selectAll(): void; + /** Deselects the rows that are currently selected within the applied filter. */ + deselectAll(): void; + /** Selects specific grid records. */ + selectRows(keys: Array, preserve: boolean): void; + /** Deselects specific grid records. */ + deselectRows(keys: Array): void; + /** Selects grid rows by indexes. */ + selectRowsByIndexes(indexes: Array): void; + /** Allows you to find out whether a row is selected or not. */ + isRowSelected(key: any): boolean; + /** Invokes the column chooser panel. */ + showColumnChooser(): void; + startSelectionWithCheckboxes(): boolean; + /** Returns the number of records currently held by a grid. */ + totalCount(): number; + /** Recovers a row deleted in the batch edit mode. */ + undeleteRow(rowIndex: number): void; + /** Allows you to obtain a data object by its key. */ + byKey(key: any): JQueryPromise; + /** Gets the value of a total summary item. */ + getTotalSummaryValue(summaryItemName: string): any; + /** Exports grid data to Excel. */ + exportToExcel(selectionOnly: boolean): void; + /** Updates the grid to the size of its content. */ + updateDimensions(): void; + /** Focuses the specified cell element in the grid. */ + focus(element?: JQuery): void; + } + export interface dxPivotGridOptions extends WidgetOptions { + onContentReady?: Function; + /** Specifies a data source for the pivot grid. */ + dataSource?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: any; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies whether to display the Total rows. */ + showRowTotals?: boolean; + /** Specifies whether to display the Grand Total row. */ + showRowGrandTotals?: boolean; + /** Specifies whether to display the Total columns. */ + showColumnTotals?: boolean; + /** Specifies whether to display the Grand Total column. */ + showColumnGrandTotals?: boolean; + /** The Field Chooser configuration options. */ + fieldChooser?: { + /** Enables or disables the field chooser. */ + enabled?: boolean; + /** Specifies the field chooser layout. */ + layout?: number; + /** Specifies the text to display as a title of the field chooser popup window. */ + title?: string; + /** Specifies the field chooser width. */ + width?: number; + /** Specifies the field chooser height. */ + height?: number; + /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** Strings that can be changed or localized in the dxPivotGrid widget. */ + texts?: { + /** The string to display as a header of the Grand Total row and column. */ + grandTotal?: string; + /** The string to display as a header of the Total row and column. */ + total?: string; + /** Specifies the text displayed when a pivot grid does not contain any fields. */ + noData?: string; + /** The string to display as a Show Field Chooser context menu item. */ + showFieldChooser?: string; + /** The string to display as an Expand All context menu item. */ + expandAll?: string; + /** The string to display as a Collapse All context menu item. */ + collapseAll?: string; + /** The string to display as a Sort Column by Summary Value context menu item. */ + sortColumnBySummary?: string; + /** The string to display as a Sort Row by Summary Value context menu item. */ + sortRowBySummary?: string; + /** The string to display as a Remove All Sorting context menu item. */ + removeAllSorting?: string; + }; + /** The Load panel configuration options. */ + loadPanel?: { + /** Enables or disables the load panel. */ + enabled?: boolean; + /** Specifies the height of the load panel. */ + height?: number; + /** Specifies the URL pointing to an image that will be used as a load indicator. */ + indicatorSrc?: string; + /** Specifies whether or not to show a load indicator. */ + showIndicator?: boolean; + /** Specifies whether or not to show load panel background. */ + showPane?: boolean; + /** Specifies the text to display inside a load panel. */ + text?: string; + /** Specifies the width of the load panel. */ + width?: number; + }; + /** A handler for the cellClick event. */ + onCellClick?: (e: any) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: any) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + } + /** A data summarization widget for multi-dimensional data analysis and data mining. */ + export class dxPivotGrid extends Widget { + constructor(element: JQuery, options?: dxPivotGridOptions); + constructor(element: Element, options?: dxPivotGridOptions); + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + } + export interface dxPivotGridFieldChooserOptions extends WidgetOptions { + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the field chooser layout. */ + layout?: number; + /** The data source of a dxPivotGrid widget. */ + dataSource?: DevExpress.data.PivotGridDataSource; + onContentReady?: Function; + /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + export class dxPivotGridFieldChooser extends Widget { + constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); + constructor(element: Element, options?: dxPivotGridFieldChooserOptions); + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + } +} +interface JQuery { + dxTreeView(): JQuery; + dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; + dxTreeView(options: string): any; + dxTreeView(options: string, ...params: any[]): any; + dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; + dxMenuBase(): JQuery; + dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; + dxMenuBase(options: string): any; + dxMenuBase(options: string, ...params: any[]): any; + dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; + dxMenu(): JQuery; + dxMenu(options: "instance"): DevExpress.ui.dxMenu; + dxMenu(options: string): any; + dxMenu(options: string, ...params: any[]): any; + dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; + dxContextMenu(): JQuery; + dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; + dxContextMenu(options: string): any; + dxContextMenu(options: string, ...params: any[]): any; + dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; + dxColorBox(): JQuery; + dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; + dxColorBox(options: string): any; + dxColorBox(options: string, ...params: any[]): any; + dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; + dxDataGrid(): JQuery; + dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; + dxDataGrid(options: string): any; + dxDataGrid(options: string, ...params: any[]): any; + dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; + dxPivotGrid(): JQuery; + dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; + dxPivotGrid(options: string): any; + dxPivotGrid(options: string, ...params: any[]): any; + dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; + dxPivotGridFieldChooser(): JQuery; + dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; + dxPivotGridFieldChooser(options: string): any; + dxPivotGridFieldChooser(options: string, ...params: any[]): any; + dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; + dxScheduler(): JQuery; + dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; + dxScheduler(options: string): any; + dxScheduler(options: string, ...params: any[]): any; + dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; +} +declare module DevExpress.framework { + /** An object used to store information on the views displayed in an application. */ + export class ViewCache { + viewRemoved: JQueryCallback; + /** Removes all the viewInfo objects from the cache. */ + clear(): void; + /** Obtains a viewInfo object from the cache by the specified key. */ + getView(key: string): Object; + /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ + hasView(key: string): boolean; + /** Removes a viewInfo object from the cache by the specified key. */ + removeView(key: string): Object; + /** Adds the specified viewInfo object to the cache under the specified key. */ + setView(key: string, viewInfo: Object): void; + } + export interface dxCommandOptions extends DOMComponentOptions { + action?: any; + /** Specifies an action performed when the execute() method of the command is called. */ + onExecute?: any; + /** Indicates whether or not the widget that displays this command is disabled. */ + disabled?: boolean; + /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ + renderStage?: string; + /** Specifies the name of the icon shown inside the widget associated with this command. */ + icon?: string; + iconSrc?: string; + /** The identifier of the command. */ + id?: string; + /** Specifies the title of the widget associated with this command. */ + title?: string; + /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + type?: string; + /** A Boolean value specifying whether or not the widget associated with this command is visible. */ + visible?: boolean; + } + /** A markup component used to define markup options for a command. */ + export class dxCommand extends DOMComponent { + constructor(element: JQuery, options: dxCommandOptions); + constructor(options: dxCommandOptions); + /** Executes the action associated with this command. */ + execute(): void; + } + /** An object responsible for routing. */ + export class Router { + /** Adds a routing rule to the list of registered rules. */ + register(pattern: string, defaults?: Object, constraints?: Object): void; + /** Decodes the specified URI to an object using the registered routing rules. */ + parse(uri: string): Object; + /** Formats an object to a URI. */ + format(obj: Object): string; + } + export interface StateManagerOptions { + /** A storage to which the state manager saves the application state. */ + storage?: Object; + } + /** An object used to store the current application state. */ + export class StateManager { + constructor(options?: StateManagerOptions); + /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ + addStateSource(stateSource: Object): void; + /** Removes a specified state source from the state manager's collection of state sources. */ + removeStateSource(stateSource: Object): void; + /** Saves the current application state. */ + saveState(): void; + /** Restores the application state that has been saved by the saveState() method to the state storage. */ + restoreState(): void; + /** Removes the application state that has been saved by the saveState() method to the state storage. */ + clearState(): void; + } + export module html { + export var layoutSets: Array; + export var animationSets: { [animationSetName: string]: AnimationSet }; + export interface AnimationSet { + [animationName: string]: any + } + export interface HtmlApplicationOptions { + /** Specifies where the commands that are defined in the application's views must be displayed. */ + commandMapping?: Object; + /** Specifies whether or not view caching is disabled. */ + disableViewCache?: boolean; + /** An array of layout controllers that should be used to show application views in the current navigation context. */ + layoutSet?: any; + /** Specifies the animation presets that are used to animate different UI elements in the current application. */ + animationSet?: AnimationSet; + /** Specifies whether the current application must behave as a mobile or web application. */ + mode?: string; + /** Specifies the object that represents a root namespace of the application. */ + namespace?: Object; + /** Specifies application behavior when the user navigates to a root view. */ + navigateToRootViewMode?: string; + /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ + navigation?: Array; + /** A state manager to be used in the application. */ + stateManager?: StateManager; + /** Specifies the storage to be used by the application's state manager to store the application state. */ + stateStorage?: Object; + /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ + useViewTitleAsBackText?: boolean; + /** A custom view cache to be used in the application. */ + viewCache?: Object; + /** Specifies a limit for the views that can be cached. */ + viewCacheSize?: number; + /** Specifies options for the viewport meta tag of a mobile browser. */ + viewPort?: JQuery; + /** A custom router to be used in the application. */ + router?: Router; + } + /** An object used to manage views, as well as control the application life cycle. */ + export class HtmlApplication implements EventsMixin { + constructor(options: HtmlApplicationOptions); + afterViewSetup: JQueryCallback; + beforeViewSetup: JQueryCallback; + initialized: JQueryCallback; + navigating: JQueryCallback; + navigatingBack: JQueryCallback; + resolveLayoutController: JQueryCallback; + viewDisposed: JQueryCallback; + viewDisposing: JQueryCallback; + viewHidden: JQueryCallback; + viewRendered: JQueryCallback; + viewShowing: JQueryCallback; + viewShown: JQueryCallback; + /** Provides access to the ViewCache object. */ + viewCache: ViewCache; + /** An array of dxCommand components that are created based on the application's navigation option value. */ + navigation: Array; + /** Provides access to the StateManager object. */ + stateManager: StateManager; + /** Provides access to the Router object. */ + router: Router; + /** Navigates to the URI preceding the current one in the navigation history. */ + back(): void; + /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ + canBack(): boolean; + /** Calls the clearState() method of the application's StateManager object. */ + clearState(): void; + /** Creates global navigation commands. */ + createNavigation(navigationConfig: Array): void; + /** Returns an HTML template of the specified view. */ + getViewTemplate(viewName: string): JQuery; + /** Returns a configuration object used to create a dxView component for a specified view. */ + getViewTemplateInfo(viewName: string): Object; + /** Adds a specified HTML template to a collection of view or layout templates. */ + loadTemplates(source: any): JQueryPromise; + /** Navigates to the specified URI. */ + navigate(uri?: any, options?: Object): void; + /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ + renderNavigation(): void; + /** Calls the restoreState() method of the application's StateManager object. */ + restoreState(): void; + /** Calls the saveState method of the application's StateManager object. */ + saveState(): void; + /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ + templateContext(): Object; + on(eventName: "initialized", eventHandler: () => void): HtmlApplication; + on(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + on(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + on(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + on(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: string, eventHandler: Function): HtmlApplication; + on(events: { [eventName: string]: Function; }): HtmlApplication; + off(eventName: "initialized"): HtmlApplication; + off(eventName: "afterViewSetup"): HtmlApplication; + off(eventName: "beforeViewSetup"): HtmlApplication; + off(eventName: "navigating"): HtmlApplication; + off(eventName: "navigatingBack"): HtmlApplication; + off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "viewDisposed"): HtmlApplication; + off(eventName: "viewDisposing"): HtmlApplication; + off(eventName: "viewHidden"): HtmlApplication; + off(eventName: "viewRendered"): HtmlApplication; + off(eventName: "viewShowing"): HtmlApplication; + off(eventName: "viewShown"): HtmlApplication; + off(eventName: string): HtmlApplication; + off(eventName: "initialized", eventHandler: () => void): HtmlApplication; + off(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + off(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + off(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + off(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: string, eventHandler: Function): HtmlApplication; + } + } +} +declare module DevExpress.viz.core { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; + export interface Border { + /** Sets a border color for a selected series. */ + color?: string; + /** Sets border visibility for a selected series. */ + visible?: boolean; + /** Sets a border width for a selected series. */ + width?: number; + } + export interface DashedBorder extends Border { + /** Specifies a dash style for the border of a selected series point. */ + dashStyle?: string; + } + export interface DashedBorderWithOpacity extends DashedBorder { + /** Specifies the opacity of the tooltip's border. */ + opacity?: number; + } + export interface Font { + /** Specifies the font color for a strip label. */ + color?: string; + /** Specifies the font family for a strip label. */ + family?: string; + /** Specifies the font opacity for a strip label. */ + opacity?: number; + /** Specifies the font size for a strip label. */ + size?: any; + /** Specifies the font weight for the text displayed in strips. */ + weight?: number; + } + export interface Hatching { + direction?: string; + /** Specifies the opacity of hatching lines. */ + opacity?: number; + /** Specifies the distance between hatching lines in pixels. */ + step?: number; + /** Specifies the width of hatching lines in pixels. */ + width?: number; + } + export interface Margins { + /** Specifies the legend's bottom margin in pixels. */ + bottom?: number; + /** Specifies the legend's left margin in pixels. */ + left?: number; + /** Specifies the legend's right margin in pixels. */ + right?: number; + /** Specifies the legend's bottom margin in pixels. */ + top?: number; + } + export interface Size { + /** Specifies the width of the widget. */ + width?: number; + /** Specifies the height of the widget. */ + height?: number; + } + export interface Tooltip { + /** Specifies the length of the tooltip's arrow in pixels. */ + arrowLength?: number; + /** Specifies the appearance of the tooltip's border. */ + border?: viz.core.DashedBorderWithOpacity; + /** Specifies a color for the tooltip. */ + color?: string; + /** Specifies the z-index for tooltips. */ + zIndex?: number; + container?: any; + /** Specifies text and appearance of a set of tooltips. */ + customizeTooltip?: (arg: Object) => { color?: string; text?: string }; + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies font options for the text displayed by the tooltip. */ + font?: Font; + /** Specifies a format for the text displayed by the tooltip. */ + format?: string; + /** Specifies the opacity of a tooltip. */ + opacity?: number; + /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ + paddingLeftRight?: number; + /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ + paddingTopBottom?: number; + /** Specifies a precision for formatted values displayed by the tooltip. */ + precision?: number; + /** Specifies options of the tooltip's shadow. */ + shadow?: { + /** Specifies the blur distance of the tooltip's shadow. */ + blur?: number; + /** Specifies the color of the tooltip's shadow. */ + color?: string; + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetX?: number; + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetY?: number; + /** Specifies the opacity of the tooltip's shadow. */ + opacity?: number; + }; + } + export interface Animation { + /** Determines how long animation runs. */ + duration?: number; + /** Specifies the animation easing mode. */ + easing?: string; + /** Indicates whether or not animation is enabled. */ + enabled?: boolean; + } + export interface LoadingIndicator { + /** Specifies a color for the loading indicator background. */ + backgroundColor?: string; + /** Specifies font options for the loading indicator text. */ + font?: viz.core.Font; + /** Specifies whether to show the loading indicator or not. */ + show?: boolean; + /** Specifies a text to be displayed by the loading indicator. */ + text?: string; + } + export interface LegendBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies a radius for the corners of the legend border. */ + cornerRadius?: number; + } + export interface BaseLegend { + /** Specifies the color of the legend's background. */ + backgroundColor?: string; + /** Specifies legend border settings. */ + border?: viz.core.LegendBorder; + /** Specifies how many columns must be taken to arrange legend items. */ + columnCount?: number; + /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ + columnItemSpacing?: number; + /** Specifies font options for legend items. */ + font?: viz.core.Font; + /** Specifies the legend's position on the map. */ + horizontalAlignment?: string; + /** Specifies the alignment of legend items. */ + itemsAlignment?: string; + /** Specifies the position of text relative to the item marker. */ + itemTextPosition?: string; + /** Specifies the distance between the legend and the container borders in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of item markers in the legend in pixels. */ + markerSize?: number; + /** Specifies whether to arrange legend items horizontally or vertically. */ + orientation?: string; + /** Specifies the spacing between the legend left/right border and legend items in pixels. */ + paddingLeftRight?: number; + /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ + paddingTopBottom?: number; + /** Specifies how many rows must be taken to arrange legend items. */ + rowCount?: number; + /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ + rowItemSpacing?: number; + /** Specifies the legend's position on the map. */ + verticalAlignment?: string; + /** Specifies whether or not the legend is visible on the map. */ + visible?: boolean; + } + export interface BaseWidgetOptions { + drawn?: (widget: Object) => void; + /** A handler for the drawn event. */ + onDrawn?: (e: { + component: BaseWidget; + element: Element; + }) => void; + incidentOccured?: (incidentInfo: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + }) => void; + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } + ) => void; + /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ + pathModified?: boolean; + /** Specifies whether or not the widget supports right-to-left representation. */ + rtlEnabled?: boolean; + /** Sets the name of the theme to be used in the widget. */ + theme?: string; + } + /** This section describes options and methods that are common to all widgets. */ + export class BaseWidget extends DOMComponent { + /** Returns the widget's SVG markup. */ + svg(): string; + } +} +declare module DevExpress.viz.charts { + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface BaseSeries { + /** Provides information about the state of the series object. */ + fullState: number; + /** Returns the type of the series. */ + type: string; + /** Unselects all the selected points of the series. The points are displayed in an initial style. */ + clearSelection(): void; + /** Gets the color of a particular series. */ + getColor(): string; + /** + * Gets a point from the series point collection based on the specified argument. + * @deprecated getPointsByArg(pointArg).md + */ + getPointByArg(pointArg: any): Object; + /** Gets points from the series point collection based on the specified argument. */ + getPointsByArg(pointArg: any): Array; + /** Gets a point from the series point collection based on the specified point position. */ + getPointByPos(positionIndex: number): Object; + /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ + select(): void; + /** Selects the specified point. The point is displayed in a 'selected' style. */ + selectPoint(point: BasePoint): void; + /** Deselects the specified point. The point is displayed in an initial style. */ + deselectPoint(point: BasePoint): void; + /** Returns an array of all points in the series. */ + getAllPoints(): Array; + /** Returns visible series points. */ + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface BasePoint { + /** Provides information about the state of the point object. */ + fullState: number; + /** Returns the point's argument value that was set in the data source. */ + originalArgument: any; + /** Returns the point's value that was set in the data source. */ + originalValue: any; + /** Returns the tag of the point. */ + tag: string; + /** Deselects the point. */ + clearSelection(): void; + /** Gets the color of a particular point. */ + getColor(): string; + /** Hides the tooltip of the point. */ + hideTooltip(): void; + /** Provides information about the hover state of a point. */ + isHovered(): any; + /** Provides information about the selection state of a point. */ + isSelected(): any; + /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ + select(): void; + /** Shows the tooltip of the point. */ + showTooltip(): void; + /** Allows you to obtain the label of a series point. */ + getLabel(): any; + /** Returns the series object to which the point belongs. */ + series: BaseSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface ChartSeries extends BaseSeries { + /** Returns the name of the series pane. */ + pane: string; + /** Returns the name of the value axis of the series. */ + axis: string; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): any; + /** Provides information about the selection state of a series. */ + isSelected(): any; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + selectPoint(point: ChartPoint): void; + deselectPoint(point: ChartPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface ChartPoint extends BasePoint { + /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalCloseValue: any; + /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalHighValue: any; + /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalLowValue: any; + /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ + originalMinValue: any; + /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalOpenValue: any; + /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ + size: any; + /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + series: ChartSeries; + } + /** This section describes the methods that can be used in code to manipulate the Label object. */ + export interface Label { + /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + /** Hides the point label. */ + hide(): void; + /** Shows the point label. */ + show(): void; + } + export interface PieSeries extends BaseSeries { + selectPoint(point: PiePoint): void; + deselectPoint(point: PiePoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PiePoint extends BasePoint { + /** Gets the percentage value of the specific point. */ + percent: any; + /** Provides information about the visibility state of a point. */ + isVisible(): boolean; + /** Makes a specific point visible. */ + show(): void; + /** Hides a specific point. */ + hide(): void; + series: PieSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface PolarSeries extends BaseSeries { + /** Returns the name of the value axis of the series. */ + axis: string; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): any; + /** Provides information about the selection state of a series. */ + isSelected(): any; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + selectPoint(point: PolarPoint): void; + deselectPoint(point: PolarPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PolarPoint extends BasePoint { + series: PolarSeries; + } + export interface Strip { + /** Specifies a color for a strip. */ + color?: string; + /** An object that defines the label configuration options of a strip. */ + label?: { + /** Specifies the text displayed in a strip. */ + text?: string; + }; + /** Specifies a start value for a strip. */ + startValue?: any; + /** Specifies an end value for a strip. */ + endValue?: any; + } + export interface BaseSeriesConfigLabel { + /** Specifies a format for arguments displayed by point labels. */ + argumentFormat?: string; + /** Specifies a precision for formatted point arguments displayed in point labels. */ + argumentPrecision?: number; + /** Specifies a background color for point labels. */ + backgroundColor?: string; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies connector options for series point labels. */ + connector?: { + /** Specifies the color of label connectors. */ + color?: string; + /** Indicates whether or not label connectors are visible. */ + visible?: boolean; + /** Specifies the width of label connectors. */ + width?: number; + }; + /** Specifies a callback function that returns the text to be displayed by point labels. */ + customizeText?: (pointInfo: Object) => string; + /** Specifies font options for the text displayed in point labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed by point labels. */ + format?: string; + position?: string; + /** Specifies a precision for formatted point values displayed in point labels. */ + precision?: number; + /** Specifies the angle used to rotate point labels from their initial position. */ + rotationAngle?: number; + /** Specifies the visibility of point labels. */ + visible?: boolean; + } + export interface SeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies whether or not to show a label when the point has a zero value. */ + showForZeroValues?: boolean; + } + export interface ChartSeriesConfigLabel extends SeriesConfigLabel { + /** Specifies how to align point labels relative to the corresponding data points that they represent. */ + alignment?: string; + /** Specifies how to shift point labels horizontally from their initial positions. */ + horizontalOffset?: number; + /** Specifies how to shift point labels vertically from their initial positions. */ + verticalOffset?: number; + /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ + percentPrecision?: number; + } + export interface BaseCommonSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + axis?: string; + /** An object defining the label configuration options for a series in the dxChart widget. */ + label?: ChartSeriesConfigLabel; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the dash style of the series' line. */ + dashStyle?: string; + hoverMode?: string; + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /**

Sets a color for a series when it is hovered over.

*/ + color?: string; + /** Specifies the dash style for the line in a hovered series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a hovered series. */ + width?: number; + }; + /** Specifies whether a chart ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies the minimal length of a displayed bar in pixels. */ + minBarSize?: number; + /** Specifies opacity for a series. */ + opacity?: number; + /** Specifies the series elements to highlight when the series is selected. */ + selectionMode?: string; + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the dash style for the line in a selected series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a selected series. */ + width?: number; + }; + /** Specifies whether or not to show the series in the chart's legend. */ + showInLegend?: boolean; + /** Specifies the name of the stack where the values of the _stackedBar_ series must be located. */ + stack?: string; + /** Specifies the name of the data source field that provides data about a point. */ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + /** Specifies the visibility of a series. */ + visible?: boolean; + /** Specifies a line width. */ + width?: number; + /** Configures error bars. */ + valueErrorBar?: { + /** Specifies whether error bars must be displayed in full or partially. */ + displayMode?: string; + /** Specifies the data field that provides data for low error values. */ + lowValueField?: string; + /** Specifies the data field that provides data for high error values. */ + highValueField?: string; + /** Specifies how error bar values must be calculated. */ + type?: string; + /** Specifies the value to be used for generating error bars. */ + value?: number; + /** Specifies the color of error bars. */ + color?: string; + /** Specifies the opacity of error bars. */ + opacity?: number; + /** Specifies the length of the lines that indicate the error bar edges. */ + edgeLength?: number; + /** Specifies the width of the error bar line. */ + lineWidth?: number; + }; + } + export interface CommonPointOptions { + /** Specifies border options for points in the line and area series. */ + border?: viz.core.Border; + /** Specifies the points color. */ + color?: string; + /** Specifies what series points to highlight when a point is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered point. */ + hoverStyle?: { + /** An object defining the border options for a hovered point. */ + border?: viz.core.Border; + /** Sets a color for a point when it is hovered over. */ + color?: string; + /** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies what series points to highlight when a point is selected. */ + selectionMode?: string; + /** An object defining configuration options for a selected point. */ + selectionStyle?: { + /** An object defining the border options for a selected point. */ + border?: viz.core.Border; + /**

Sets a color for a point when it is selected.

*/ + color?: string; + /** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */ + size?: number; + /** Specifies a symbol for presenting points of the line and area series. */ + symbol?: string; + visible?: boolean; + } + export interface ChartCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: any; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: any; + /** Specifies the width of an image that is used as a point marker. */ + width?: any; + }; + } + export interface PolarCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: number; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: string; + /** Specifies the width of an image that is used as a point marker. */ + width?: number; + }; + } + /** An object that defines configuration options for chart series. */ + export interface CommonSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies the data source field that provides a 'close' value for a _candleStick_ or _stock_ series. */ + closeValueField?: string; + /** Specifies a radius for bar corners. */ + cornerRadius?: number; + /** Specifies the data source field that provides a 'high' value for a _candleStick_ or _stock_ series. */ + highValueField?: string; + /** Specifies the color for the body (rectangle) of a _candleStick_ series. */ + innerColor?: string; + /** Specifies the data source field that provides a 'low' value for a _candleStick_ or _stock_ series. */ + lowValueField?: string; + /** Specifies the data source field that provides an 'open' value for a _candleStick_ or _stock_ series. */ + openValueField?: string; + /** Specifies the pane that will be used to display a series. */ + pane?: string; + /** An object defining configuration options for points in line-, scatter- and area-like series. */ + point?: ChartCommonPointOptions; + /** Specifies the data source field that provides values for one end of a range series. To set the data source field for the other end of the range series, use the rangeValue2Field property. */ + rangeValue1Field?: string; + /** Specifies the data source field that provides values for the second end of a range series. To set the data source field for the other end of the range series, use the rangeValue1Field property. */ + rangeValue2Field?: string; + /** Specifies reduction options for the stock or candleStick series. */ + reduction?: { + /** Specifies a color for the points whose reduction level price is lower in comparison to the value in the previous point. */ + color?: string; + /** Specifies for which price level (open, high, low or close) to enable reduction options in the series. */ + level?: string; + }; + /** Specifies the data source field that defines the size of bubbles. */ + sizeField?: string; + } + export interface CommonSeriesSettings extends CommonSeriesConfig { + /**

An object that specifies configuration options for all series of the area type in the chart.

*/ + area?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the bubble type in the chart. */ + bubble?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _candleStick_ type in the chart. */ + candlestick?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedArea_ type in the chart. */ + fullstackedarea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Full-Stacked Spline Area type in the chart. */ + fullstackedsplinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedBar_ type in the chart. */ + fullstackedbar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedLine_ type in the chart. */ + fullstackedline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Full-Stacked Spline type in the chart. */ + fullstackedspline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _rangeArea_ type in the chart. */ + rangearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _rangeBar_ type in the chart. */ + rangebar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _spline_ type in the chart. */ + spline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _splineArea_ type in the chart. */ + splinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedArea_ type in the chart. */ + stackedarea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Stacked Spline Area type in the chart. */ + stackedsplinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedLine_ type in the chart. */ + stackedline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Stacked Spline type in the chart. */ + stackedspline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stepArea_ type in the chart. */ + steparea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stepLine_ type in the chart. */ + stepline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stock_ type in the chart. */ + stock?: CommonSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface SeriesConfig extends CommonSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + /** An object that defines configuration options for polar chart series. */ + export interface CommonPolarSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies whether or not to close the chart by joining the end point with the first point. */ + closed?: boolean; + label?: SeriesConfigLabel; + point?: PolarCommonPointOptions; + } + export interface CommonPolarSeriesSettings extends CommonPolarSeriesConfig { + /** An object that specifies configuration options for all series of the area type in the chart. */ + area?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonPolarSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface PolarSeriesConfig extends CommonPolarSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + export interface PieSeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies how to shift labels from their initial position in a radial direction in pixels. */ + radialOffset?: number; + /** Specifies a precision for the percentage values displayed in labels. */ + percentPrecision?: number; + } + /** An object that defines configuration options for chart series. */ + export interface CommonPieSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + /** Specifies the required type for series arguments. */ + argumentType?: string; + /** An object defining the series border configuration options. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the chart elements to highlight when a series is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered series. */ + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /** Sets a color for the series when it is hovered over. */ + color?: string; + /** Specifies the hatching options to be applied when a point is hovered over. */ + hatching?: viz.core.Hatching; + }; + /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. */ + innerRadius?: number; + /** An object defining the label configuration options. */ + label?: PieSeriesConfigLabel; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies a minimal size of a displayed pie segment. */ + minSegmentSize?: number; + /** Specifies the direction in which the dxPieChart's series points are located. */ + segmentsDirection?: string; + /**

Specifies the chart elements to highlight when the series is selected.

*/ + selectionMode?: string; + /** An object defining configuration options for the series when it is selected. */ + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the hatching options to be applied when a point is selected. */ + hatching?: viz.core.Hatching; + }; + /** Specifies chart segment grouping options. */ + smallValuesGrouping?: { + /** Specifies the name of the grouped chart segment. This name represents the segment in the chart legend. */ + groupName?: string; + /** Specifies the segment grouping mode. */ + mode?: string; + /** Specifies a threshold for segment values. */ + threshold?: number; + /** Specifies how many segments must not be grouped. */ + topCount?: number; + }; + /** Specifies a start angle for a pie chart in arc degrees. */ + startAngle?: number; + /**

Specifies the name of the data source field that provides data about a point.

*/ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + } + export interface PieSeriesConfig extends CommonPieSeriesConfig { + /** Sets the series type. */ + type?: string; + } + export interface SeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => SeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface PolarSeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => PolarSeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface ChartCommonConstantLineLabel { + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + /** Specifies the position of the constant line label relative to the chart plot. */ + position?: string; + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + } + export interface PolarCommonConstantLineLabel { + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + } + export interface ConstantLineStyle { + /** Specifies a color for a constant line. */ + color?: string; + /** Specifies a dash style for a constant line. */ + dashStyle?: string; + /** Specifies a constant line width in pixels. */ + width?: number; + } + export interface ChartCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartCommonConstantLineLabel; + /** Specifies the space between the constant line label and the left/right side of the constant line. */ + paddingLeftRight?: number; + /** Specifies the space between the constant line label and the top/bottom side of the constant line. */ + paddingTopBottom?: number; + } + export interface PolarCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarCommonConstantLineLabel; + } + export interface CommonAxisLabel { + /** Specifies font options for axis labels. */ + font?: viz.core.Font; + /** Specifies the spacing between an axis and its labels in pixels. */ + indentFromAxis?: number; + /** Indicates whether or not axis labels are visible. */ + visible?: boolean; + } + export interface ChartCommonAxisLabel extends CommonAxisLabel { + /** Specifies the label's position relative to the tick (grid line). */ + alignment?: string; + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: { + /** Specifies how to arrange axis labels. */ + mode?: string; + /** Specifies the angle used to rotate axis labels. */ + rotationAngle?: number; + /** Specifies the spacing that must be set between staggered rows when the 'stagger' algorithm is applied. */ + staggeringSpacing?: number; + }; + } + export interface PolarCommonAxisLabel extends CommonAxisLabel { + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: string; + } + export interface CommonAxisTitle { + /** Specifies font options for an axis title. */ + font?: viz.core.Font; + /** Specifies a margin for an axis title in pixels. */ + margin?: number; + } + export interface BaseCommonAxisSettings { + /** Specifies the color of the line that represents an axis. */ + color?: string; + /** Specifies whether ticks/grid lines of a discrete axis are located between labels or cross the labels. */ + discreteAxisDivisionMode?: string; + /** An object defining the configuration options for the grid lines of an axis in the dxPolarChart widget. */ + grid?: { + /** Specifies a color for grid lines. */ + color?: string; + /** Specifies an opacity for grid lines. */ + opacity?: number; + /** Indicates whether or not the grid lines of an axis are visible. */ + visible?: boolean; + /** Specifies the width of grid lines. */ + width?: number; + }; + /** Specifies the options of the minor grid. */ + minorGrid?: { + /** Specifies a color for the lines of the minor grid. */ + color?: string; + /** Specifies an opacity for the lines of the minor grid. */ + opacity?: number; + /** Indicates whether the minor grid is visible or not. */ + visible?: boolean; + /** Specifies a width for the lines of the minor grid. */ + width?: number; + }; + /** Indicates whether or not an axis is inverted. */ + inverted?: boolean; + /** Specifies the opacity of the line that represents an axis. */ + opacity?: number; + /** Indicates whether or not to set ticks/grid lines of a continuous axis of the 'date-time' type at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** An object defining the configuration options for axis ticks. */ + tick?: { + /** Specifies ticks color. */ + color?: string; + /** Specifies tick opacity. */ + opacity?: number; + /** Indicates whether or not ticks are visible on an axis. */ + visible?: boolean; + }; + /** Specifies the options of the minor ticks. */ + minorTick?: { + /** Specifies a color for the minor ticks. */ + color?: string; + /** Specifies an opacity for the minor ticks. */ + opacity?: number; + /** Indicates whether or not the minor ticks are displayed on an axis. */ + visible?: boolean; + }; + /** Indicates whether or not the line that represents an axis in a chart is visible. */ + visible?: boolean; + /** Specifies the width of the line that represents an axis in the chart. */ + width?: number; + } + export interface ChartCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxChart widget. */ + label?: ChartCommonAxisLabel; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + /** Specifies, in pixels, the space reserved for an axis. */ + placeholderSize?: number; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + /** Specifies the label's position on a strip. */ + horizontalAlignment?: string; + /** Specifies a label's position on a strip. */ + verticalAlignment?: string; + }; + /** Specifies the spacing, in pixels, between the left/right strip border and the strip label. */ + paddingLeftRight?: number; + /** Specifies the spacing, in pixels, between the top/bottom strip borders and the strip label. */ + paddingTopBottom?: number; + }; + /** An object defining the title configuration options that are common for all axes in the dxChart widget. */ + title?: CommonAxisTitle; + /** Indicates whether or not to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + } + export interface PolarCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: PolarCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxPolarChart widget. */ + label?: PolarCommonAxisLabel; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + }; + }; + } + export interface ChartConstantLineLabel extends ChartCommonConstantLineLabel { + /** Specifies the horizontal alignment of a constant line label. */ + horizontalAlignment?: string; + /** Specifies the vertical alignment of a constant line label. */ + verticalAlignment?: string; + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface PolarConstantLineLabel extends PolarCommonConstantLineLabel { + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface AxisLabel { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */ + customizeHint?: (argument: { value: any; valueText: string }) => string; + /** Specifies a callback function that returns the text to be displayed in value axis labels. */ + customizeText?: (argument: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed by axis labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the axis labels. */ + precision?: number; + } + export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { } + export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { } + export interface AxisTitle extends CommonAxisTitle { + /** Specifies the text for the value axis title. */ + text?: string; + } + export interface ChartConstantLineStyle extends ChartCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartConstantLineLabel; + } + export interface ChartConstantLine extends ChartConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface PolarConstantLine extends PolarCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface Axis { + /** Specifies a coefficient for dividing the value axis. */ + axisDivisionFactor?: number; + /** Specifies the order in which discrete values are arranged on the value axis. */ + categories?: Array; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic axis. */ + logarithmBase?: number; + /** Specifies an interval between axis ticks/grid lines. */ + tickInterval?: any; + /** Specifies the interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the number of minor ticks between two neighboring major ticks. */ + minorTickCount?: number; + /** Specifies the required type of the value axis. */ + type?: string; + /** Specifies the pane on which the current value axis will be displayed. */ + pane?: string; + /** Specifies options for value axis strips. */ + strips?: Array; + } + export interface ChartAxis extends ChartCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies the appearance options for the constant lines of the value axis. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** Specifies options for value axis labels. */ + label?: ChartAxisLabel; + /** Specifies the maximum value on the value axis. */ + max?: any; + /** Specifies the minimum value on the value axis. */ + min?: any; + /** Specifies the position of the value axis on a chart. */ + position?: string; + /** Specifies the title for a value axis. */ + title?: AxisTitle; + } + export interface PolarAxis extends PolarCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies options for value axis labels. */ + label?: PolarAxisLabel; + } + export interface ArgumentAxis { + /** Specifies the desired type of axis values. */ + argumentType?: string; + /** Specifies the elements that will be highlighted when the argument axis is hovered over. */ + hoverMode?: string; + } + export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { } + export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis { + /** Specifies a start angle for the argument axis in degrees. */ + startAngle?: number; + /** Specifies whether or not to display the first point at the angle specified by the startAngle option. */ + firstPointOnStartAngle?: boolean; + /** Specifies the period of the argument values in the data source. */ + period?: number; + } + export interface ValueAxis { + /** Specifies the name of the value axis. */ + name?: string; + /** Specifies whether or not to indicate a zero value on the value axis. */ + showZero?: boolean; + /** Specifies the desired type of axis values. */ + valueType?: string; + } + export interface ChartValueAxis extends ChartAxis, ValueAxis { + /** Specifies the spacing, in pixels, between multiple value axes in a chart. */ + multipleAxesSpacing?: number; + /** Specifies the value by which the chart's value axes are synchronized. */ + synchronizedValue?: number; + } + export interface PolarValueAxis extends PolarAxis, ValueAxis { + /** Indicates whether to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + tick?: { + visible?: boolean; + } + } + export interface CommonPane { + /** Specifies a background color in a pane. */ + backgroundColor?: string; + /** Specifies the border options of a chart's pane. */ + border?: PaneBorder; + } + export interface Pane extends CommonPane { + /** Specifies the name of a pane. */ + name?: string; + } + export interface PaneBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies the bottom border's visibility state in a pane. */ + bottom?: boolean; + /** Specifies the left border's visibility state in a pane. */ + left?: boolean; + /** Specifies the right border's visibility state in a pane. */ + right?: boolean; + /** Specifies the top border's visibility state in a pane. */ + top?: boolean; + } + export interface ChartAnimation extends viz.core.Animation { + /** Specifies the maximum series point count in the chart that the animation supports. */ + maxPointCountSupported?: number; + } + export interface BaseChartTooltip extends viz.core.Tooltip { + /** Specifies a format for arguments of the chart's series points. */ + argumentFormat?: string; + /** Specifies a precision for formatted arguments displayed in tooltips. */ + argumentPrecision?: number; + /** Specifies a precision for a percent value displayed in tooltips for stacked series and dxPieChart series. */ + percentPrecision?: number; + } + export interface BaseChartOptions extends viz.core.BaseWidgetOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies the width of the widget that is small enough for the layout to begin adapting. */ + width?: number; + /** Specifies the height of the widget that is small enough for the layout to begin adapting. */ + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies animation options. */ + animation?: ChartAnimation; + /** Specifies a callback function that returns an object with options for a specific point label. */ + customizeLabel?: (labelInfo: Object) => Object; + /** Specifies a callback function that returns an object with options for a specific point. */ + customizePoint?: (pointInfo: Object) => Object; + /** Specifies a data source for the chart. */ + dataSource?: any; + done?: Function; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies options of a dxChart's (dxPieChart's) legend. */ + legend?: core.BaseLegend; + /** Specifies the blank space between the chart's extreme elements and the boundaries of the area provided for the widget (see size) in pixels. */ + margin?: viz.core.Margins; + /** Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** A handler for the done event. */ + onDone?: (e: { + component: BaseChart; + element: Element; + }) => void; + /** A handler for the pointClick event. */ + onPointClick?: any; + pointClick?: any; + /** A handler for the pointHoverChanged event. */ + onPointHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + pointHoverChanged?: (point: TPoint) => void; + /** A handler for the pointSelectionChanged event. */ + onPointSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + pointSelectionChanged?: (point: TPoint) => void; + /** Specifies whether a single point or multiple points can be selected in the chart. */ + pointSelectionMode?: string; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options for the dxChart and dxPieChart widget series. */ + series?: any; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** Specifies a title for the chart. */ + title?: { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the title's horizontal position in the chart. */ + horizontalAlignment?: string; + /** Specifies a title's position on the chart in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the distance between the title and surrounding chart elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies a text for the chart's title. */ + text?: string; + }; + /** Specifies tooltip options. */ + tooltip?: BaseChartTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + tooltipHidden?: (point: TPoint) => void; + tooltipShown?: (point: TPoint) => void; + } + /** A base class for all chart widgets included in the ChartJS library. */ + export class BaseChart extends viz.core.BaseWidget { + /** Deselects the chart's selected series. The series is displayed in an initial style. */ + clearSelection(): void; + /** Gets the current size of the widget. */ + getSize(): { width: number; height: number }; + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Hides all widget tooltips. */ + hideTooltip(): void; + /** Redraws a widget. */ + render(renderOptions?: { + force?: boolean; + animate?: boolean; + asyncSeriesRendering?: boolean; + }): void; + } + export interface AdvancedLegend extends core.BaseLegend { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /**

Specifies a callback function that returns the text to be displayed by legend items.

*/ + customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + } + export interface AdvancedOptions extends BaseChartOptions { + /** A handler for the argumentAxisClick event. */ + onArgumentAxisClick?: any; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate the values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort the series points. */ + sortingMethod?: any; + }; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** A handler for the seriesClick event. */ + onSeriesClick?: any; + /** A handler for the seriesHoverChanged event. */ + onSeriesHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** A handler for the seriesSelectionChanged event. */ + onSeriesSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** Specifies whether a single series or multiple series can be selected in the chart. */ + seriesSelectionMode?: string; + /** Specifies how the chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + } + export interface Legend extends AdvancedLegend { + /** Specifies whether the legend is located outside or inside the chart's plot. */ + position?: string; + } + export interface ChartTooltip extends BaseChartTooltip { + /** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies to the Bar and Bubble series. */ + location?: string; + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxChartOptions extends AdvancedOptions { + /** Specifies a value indicating whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: any; + adaptiveLayout?: { + keepLabels?: boolean; + }; + /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ + synchronizeMultiAxes?: boolean; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart. */ + adjustOnZoom?: boolean; + /** Specifies argument axis options for the dxChart widget. */ + argumentAxis?: ChartArgumentAxis; + argumentAxisClick?: any; + /** An object defining the configuration options that are common for all axes of the dxChart widget. */ + commonAxisSettings?: ChartCommonAxisSettings; + /** An object defining the configuration options that are common for all panes in the dxChart widget. */ + commonPaneSettings?: CommonPane; + /** An object defining the configuration options that are common for all series of the dxChart widget. */ + commonSeriesSettings?: CommonSeriesSettings; + /** An object that specifies the appearance options of the chart crosshair. */ + crosshair?: { + /** Specifies a color for the crosshair lines. */ + color?: string; + /** Specifies a dash style for the crosshair lines. */ + dashStyle?: string; + /** Specifies whether to enable the crosshair or not. */ + enabled?: boolean; + /** Specifies the opacity of the crosshair lines. */ + opacity?: number; + /** Specifies the width of the crosshair lines. */ + width?: number; + /** Specifies the appearance of the horizontal crosshair line. */ + horizontalLine?: CrosshaierWithLabel; + /** Specifies the appearance of the vertical crosshair line. */ + verticalLine?: CrosshaierWithLabel; + /** Specifies the options of the crosshair labels. */ + label?: { + /** Specifies a color for the background of the crosshair labels. */ + backgroundColor?: string; + /** Specifies whether the crosshair labels are visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the crosshair labels. */ + font?: viz.core.Font; + } + }; + /** Specifies a default pane for the chart's series. */ + defaultPane?: string; + /** Specifies a coefficient determining the diameter of the largest bubble. */ + maxBubbleSize?: number; + /** Specifies the diameter of the smallest bubble measured in pixels. */ + minBubbleSize?: number; + /** Defines the dxChart widget's pane(s). */ + panes?: Array; + /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ + rotated?: boolean; + /** Specifies the options of a chart's legend. */ + legend?: Legend; + /** Specifies options for dxChart widget series. */ + series?: Array; + legendClick?: any; + seriesClick?: any; + seriesHoverChanged?: (series: ChartSeries) => void; + seriesSelectionChanged?: (series: ChartSeries) => void; + /** Defines options for the series template. */ + seriesTemplate?: SeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: ChartTooltip; + /** Specifies value axis options for the dxChart widget. */ + valueAxis?: Array; + /** Enables scrolling in your chart. */ + scrollingMode?: string; + /** Enables zooming in your chart. */ + zoomingMode?: string; + /** Specifies the settings of the scroll bar. */ + scrollBar?: { + /** Specifies whether the scroll bar is visible or not. */ + visible?: boolean; + /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ + offset?: number; + /** Specifies the color of the scroll bar. */ + color?: string; + /** Specifies the width of the scroll bar in pixels. */ + width?: number; + /** Specifies the opacity of the scroll bar. */ + opacity?: number; + /** Specifies the position of the scroll bar in the chart. */ + position?: string; + }; + } + /** A widget used to embed charts into HTML JS applications. */ + export class dxChart extends BaseChart { + constructor(element: JQuery, options?: dxChartOptions); + constructor(element: Element, options?: dxChartOptions); + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): ChartSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): ChartSeries; + /** Sets the specified start and end values for the chart's argument axis. */ + zoomArgument(startValue: any, endValue: any): void; + } + interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { + /** Configures the label that belongs to the horizontal crosshair line. */ + label?: { + /** Specifies a color for the background of the label that belongs to the horizontal crosshair line. */ + backgroundColor?: string; + /** Specifies whether the label of the horizontal crosshair line is visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */ + font?: viz.core.Font; + } + } + export interface PolarChartTooltip extends BaseChartTooltip { + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxPolarChartOptions extends AdvancedOptions { + /** Specifies a value indicating whether all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + width?: number; + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Indicates whether or not to display a "spider web". */ + useSpiderWeb?: boolean; + /** Specifies argument axis options for the dxPolarChart widget. */ + argumentAxis?: PolarArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ + commonAxisSettings?: PolarCommonAxisSettings; + /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ + commonSeriesSettings?: CommonPolarSeriesSettings; + /** Specifies the options of a chart's legend. */ + legend?: AdvancedLegend; + /** Specifies options for dxPolarChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: PolarSeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: PolarChartTooltip; + /** Specifies value axis options for the dxPolarChart widget. */ + valueAxis?: PolarValueAxis; + } + /** A chart widget displaying data in a polar coordinate system. */ + export class dxPolarChart extends BaseChart { + constructor(element: JQuery, options?: dxPolarChartOptions); + constructor(element: Element, options?: dxPolarChartOptions); + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): PolarSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): PolarSeries; + } + export interface PieLegend extends core.BaseLegend { + /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + /** Specifies a callback function that returns the text to be displayed by a legend item. */ + customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + } + export interface dxPieChartOptions extends BaseChartOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies dxPieChart legend options. */ + legend?: PieLegend; + /** Specifies options for the series of the dxPieChart widget. */ + series?: Array; + /** Specifies the diameter of the pie. */ + diameter?: number; + /** A handler for the legendClick event. */ + onLegendClick?: any; + legendClick?: any; + /** Specifies how a chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + } + /** A circular chart widget for HTML JS applications. */ + export class dxPieChart extends BaseChart { + constructor(element: JQuery, options?: dxPieChartOptions); + constructor(element: Element, options?: dxPieChartOptions); + /** Provides access to the dxPieChart series. */ + getSeries(): PieSeries; + } +} +interface JQuery { + dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; + dxChart(methodName: string, ...params: any[]): any; + dxChart(methodName: "instance"): DevExpress.viz.charts.dxChart; + dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; + dxPieChart(methodName: string, ...params: any[]): any; + dxPieChart(methodName: "instance"): DevExpress.viz.charts.dxPieChart; + dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; + dxPolarChart(methodName: string, ...params: any[]): any; + dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; +} +declare module DevExpress.viz.gauges { + export interface BaseRangeContainer { + /** Specifies a range container's background color. */ + backgroundColor?: string; + /** Specifies the offset of the range container from an invisible scale line in pixels. */ + offset?: number; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** An array of objects representing ranges contained in the range container. */ + ranges?: Array<{ startValue: number; endValue: number; color: string }>; + /** Specifies a color of a range. */ + color?: string; + /** Specifies an end value of a range. */ + endValue?: number; + /** Specifies a start value of a range. */ + startValue?: number; + } + export interface ScaleTick { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** Specifies an array of custom minor ticks. */ + customTickValues?: Array; + /** Specifies the length of the scale's minor ticks. */ + length?: number; + /** Indicates whether automatically calculated minor ticks are visible or not. */ + showCalculatedTicks?: boolean; + /** Specifies an interval between minor ticks. */ + tickInterval?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + } + export interface ScaleMajorTick extends ScaleTick { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + } + export interface BaseScaleLabel { + /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ + useRangeColors?: boolean; + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies font options for the text displayed in the scale labels of the gauge. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies whether or not scale labels are visible on the gauge. */ + visible?: boolean; + } + export interface BaseScale { + /** Specifies the end value for the scale of the gauge. */ + endValue?: number; + /** Specifies whether or not to hide the first scale label. */ + hideFirstLabel?: boolean; + /** Specifies whether or not to hide the first major tick on the scale. */ + hideFirstTick?: boolean; + /** Specifies whether or not to hide the last scale label. */ + hideLastLabel?: boolean; + /** Specifies whether or not to hide the last major tick on the scale. */ + hideLastTick?: boolean; + /** Specifies common options for scale labels. */ + label?: BaseScaleLabel; + /** Specifies options of the gauge's major ticks. */ + majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's minor ticks. */ + minorTick?: ScaleTick; + /** Specifies the start value for the scale of the gauge. */ + startValue?: number; + } + export interface BaseValueIndicator { + /** Specifies the type of subvalue indicators. */ + type?: string; + /** Specifies the background color for the indicator of the rangeBar type. */ + backgroundColor?: string; + /** Specifies the base value for the indicator of the rangeBar type. */ + baseValue?: number; + /** Specifies a color of the indicator. */ + color?: string; + /** Specifies the range bar size for an indicator of the rangeBar type. */ + size?: number; + text?: { + /** Specifies a callback function that returns the text to be displayed in an indicator. */ + customizeText?: (indicatedValue: { value: number; valueText: string }) => string; + font?: viz.core.Font; + /** Specifies a format for the text displayed in an indicator. */ + format?: string; + /** Specifies the range bar's label indent in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by an indicator. */ + precision?: number; + }; + offset?: number; + length?: number; + width?: number; + /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ + arrowLength?: number; + /** Sets the array of colors to be used for coloring subvalue indicators. */ + palette?: Array; + /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ + indentFromCenter?: number; + /** Specifies the second color for the indicator of the twoColorNeedle type. */ + secondColor?: string; + /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ + secondFraction?: number; + /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ + spindleSize?: number; + /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ + spindleGapSize?: number; + /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface SharedGaugeOptions { + /** Specifies animation options. */ + animation?: viz.core.Animation; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** Specifies a subtitle for a gauge. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies a text for the subtitle. */ + text?: string; + }; + /** Specifies a title for a gauge. */ + title?: { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies a title's position on the gauge. */ + position?: string; + /** Specifies a text for the title. */ + text?: string; + }; + /** Specifies options for gauge tooltips. */ + tooltip?: viz.core.Tooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + } + export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies the blank space in pixels between the widget's extreme elements and the boundaries of the area provided for the widget (see the size option). */ + margin?: viz.core.Margins; + /** Specifies options of the gauge's range container. */ + rangeContainer?: BaseRangeContainer; + /** Specifies a gauge's scale options. */ + scale?: BaseScale; + /** Specifies the appearance options of subvalue indicators. */ + subvalueIndicator?: BaseValueIndicator; + /** Specifies a set of subvalues to be designated by the subvalue indicators. */ + subvalues?: Array; + /** Specifies the main value on a gauge. */ + value?: number; + /** Specifies the appearance options of the value indicator. */ + valueIndicator?: BaseValueIndicator; + } + /** A gauge widget. */ + export class dxBaseGauge extends viz.core.BaseWidget { + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Returns the main gauge value. */ + value(): number; + /** Updates a gauge value. */ + value(value: number): void; + /** Returns an array of gauge subvalues. */ + subvalues(): Array; + /** Updates gauge subvalues. */ + subvalues(subvalues: Array): void; + } + export interface LinearRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ + width?: any; + /** Specifies an end width of a range container. */ + end?: number; + /** Specifies a start width of a range container. */ + start?: number; + } + export interface LinearScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface LinearScale extends BaseScale { + /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + label?: LinearScaleLabel; + /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface dxLinearGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ + geometry?: { + /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ + orientation?: string; + }; + /** Specifies gauge range container options. */ + rangeContainer?: LinearRangeContainer; + scale?: LinearScale; + } + /** A widget that represents a gauge with a linear scale. */ + export class dxLinearGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxLinearGaugeOptions); + constructor(element: Element, options?: dxLinearGaugeOptions); + } + export interface CircularRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container in the dxCircularGauge widget. */ + orientation?: string; + /** Specifies the range container's width in pixels. */ + width?: number; + } + export interface CircularScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface CircularScale extends BaseScale { + label?: CircularScaleLabel; + /** Specifies the orientation of scale ticks. */ + orientation?: string; + } + export interface dxCircularGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ + geometry?: { + /** Specifies the end angle of the circular gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the circular gauge's arc. */ + startAngle?: number; + }; + /** Specifies gauge range container options. */ + rangeContainer?: CircularRangeContainer; + scale?: CircularScale; + } + /** A widget that represents a gauge with a circular scale. */ + export class dxCircularGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxCircularGaugeOptions); + constructor(element: Element, options?: dxCircularGaugeOptions); + } + export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies a color for the remaining segment of the bar's track. */ + backgroundColor?: string; + /** Specifies a distance between bars in pixels. */ + barSpacing?: number; + /** Specifies a base value for bars. */ + baseValue?: number; + /** Specifies an end value for the gauge's invisible scale. */ + endValue?: number; + /** Defines the shape of the gauge's arc. */ + geometry?: { + /** Specifies the end angle of the bar gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the bar gauge's arc. */ + startAngle?: number; + }; + /** Specifies the options of the labels that accompany gauge bars. */ + label?: { + /** Specifies a color for the label connector text. */ + connectorColor?: string; + /** Specifies the width of the label connector in pixels. */ + connectorWidth?: number; + /** Specifies a callback function that returns a text for labels. */ + customizeText?: (barValue: { value: number; valueText: string }) => string; + /** Specifies font options for bar labels. */ + font?: viz.core.Font; + /** Specifies a format for bar labels. */ + format?: string; + /** Specifies the distance between the upper bar and bar labels in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by labels. */ + precision?: number; + /** Specifies whether bar labels appear on a gauge or not. */ + visible?: boolean; + }; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: string; + /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ + relativeInnerRadius?: number; + /** Specifies a start value for the gauge's invisible scale. */ + startValue?: number; + /** Specifies the array of values to be indicated on a bar gauge. */ + values?: Array; + } + /** A circular bar widget. */ + export class dxBarGauge extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxBarGaugeOptions); + constructor(element: Element, options?: dxBarGaugeOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws the widget. */ + render(): void; + /** Returns an array of gauge values. */ + values(): Array; + /** Updates the values displayed by a gauge. */ + values(values: Array): void; + } +} +interface JQuery { + dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; + dxLinearGauge(methodName: string, ...params: any[]): any; + dxLinearGauge(methodName: "instance"): DevExpress.viz.gauges.dxLinearGauge; + dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; + dxCircularGauge(methodName: string, ...params: any[]): any; + dxCircularGauge(methodName: "instance"): DevExpress.viz.gauges.dxCircularGauge; + dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; + dxBarGauge(methodName: string, ...params: any[]): any; + dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; +} +declare module DevExpress.viz.rangeSelector { + export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { + /** Specifies the options for the range selector's background. */ + background?: { + /** Specifies the background color for the dxRangeSelector. */ + color?: string; + /** Specifies image options. */ + image?: { + /** Specifies a location for the image in the background of a range selector. */ + location?: string; + /** Specifies the image's URL. */ + url?: string; + }; + /** Indicates whether or not the background (background color and/or image) is visible. */ + visible?: boolean; + }; + /** Specifies the dxRangeSelector's behavior options. */ + behavior?: { + /** Indicates whether or not you can swap sliders. */ + allowSlidersSwap?: boolean; + /** Indicates whether or not animation is enabled. */ + animationEnabled?: boolean; + /** Specifies when to call the onSelectedRangeChanged function. */ + callSelectedRangeChanged?: string; + /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ + manualRangeSelectionEnabled?: boolean; + /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ + moveSelectedRangeByClick?: boolean; + /** Indicates whether to snap a slider to ticks. */ + snapToTicks?: boolean; + }; + /** Specifies the options required to display a chart as the range selector's background. */ + chart?: { + /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ + bottomIndent?: number; + /** An object defining the common configuration options for the chart’s series. */ + commonSeriesSettings?: viz.charts.CommonSeriesSettings; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort series points. */ + sortingMethod?: any; + }; + /** Specifies a value indicating whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: any; + /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** An object defining the chart’s series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: viz.charts.SeriesTemplate; + /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ + topIndent?: number; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies options for the chart's value axis. */ + valueAxis?: { + /** Indicates whether or not the chart's value axis must be inverted. */ + inverted?: boolean; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ + logarithmBase?: number; + /** Specifies the maximum value of the chart's value axis. */ + max?: number; + /** Specifies the minimum value of the chart's value axis. */ + min?: number; + /** Specifies the type of the value axis. */ + type?: string; + /** Specifies the desired type of axis values. */ + valueType?: string; + }; + }; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies a data source for the scale values and for the chart at the background. */ + dataSource?: any; + /** Specifies the data source field that provides data for the scale. */ + dataSourceField?: string; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size). */ + margin?: viz.core.Margins; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options of the range selector's scale. */ + scale?: { + /** Specifies the scale's end value. */ + endValue?: any; + /** Specifies common options for scale labels. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: any; valueText: string; }) => string; + /** Specifies font options for the text displayed in the range selector's scale labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies a spacing between scale labels and the background bottom edge. */ + topIndent?: number; + /** Specifies whether or not the scale's labels are visible. */ + visible?: boolean; + }; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ + logarithmBase?: number; + /** Specifies an interval between major ticks. */ + majorTickInterval?: any; + /** Specifies options for the date-time scale's markers. */ + marker?: { + /** Defines the options that can be set for the text that is displayed by the scale markers. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale markers. */ + customizeText?: (markerValue: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed in scale markers. */ + format?: string; + }; + /** Specifies the height of the marker's separator. */ + separatorHeight?: number; + /** Specifies the space between the marker label and the marker separator. */ + textLeftIndent?: number; + /** Specifies the space between the marker's label and the top edge of the marker's separator. */ + textTopIndent?: number; + /** Specified the indent between the marker and the scale lables. */ + topIndent?: number; + /** Indicates whether scale markers are visible. */ + visible?: boolean; + }; + /** Specifies the maximum range that can be selected. */ + maxRange?: any; + /** Specifies the number of minor ticks between neighboring major ticks. */ + minorTickCount?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the minimum range that can be selected. */ + minRange?: any; + /** Specifies the height of the space reserved for the scale in pixels. */ + placeholderHeight?: number; + /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ + showCustomBoundaryTicks?: boolean; + /** Indicates whether or not to show minor ticks on the scale. */ + showMinorTicks?: boolean; + /** Specifies the scale's start value. */ + startValue?: any; + /** Specifies options defining the appearance of scale ticks. */ + tick?: { + /** Specifies the color of scale ticks (both major and minor ticks). */ + color?: string; + /** Specifies the opacity of scale ticks (both major and minor ticks). */ + opacity?: number; + /** Specifies the width of the scale's ticks (both major and minor ticks). */ + width?: number; + }; + /** Specifies the type of the scale. */ + type?: string; + /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + /** Specifies the type of values on the scale. */ + valueType?: string; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; + }; + /** Specifies the range to be selected when displaying the dxRangeSelector. */ + selectedRange?: { + /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + startValue?: any; + /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + endValue?: any; + }; + /** Specifies the color of the selected range. */ + selectedRangeColor?: string; + /** Range selector's indent options. */ + indent?: { + /** Specifies range selector's left indent. */ + left?: number; + /** Specifies range selector's right indent. */ + right?: number; + }; + selectedRangeChanged?: (selectedRange: { startValue: any; endValue: any; }) => void; + /** A handler for the selectedRangeChanged event. */ + onSelectedRangeChanged?: (e: { + startValue: any; + endValue: any; + component: dxRangeSelector; + element: Element; + }) => void; + /** Specifies range selector shutter options. */ + shutter?: { + /** Specifies shutter color. */ + color?: string; + /** Specifies the opacity of the color of shutters. */ + opacity?: number; + }; + /** Specifies in pixels the size of the dxRangeSelector widget. */ + size?: viz.core.Size; + /** Specifies the appearance of the range selector's slider handles. */ + sliderHandle?: { + /** Specifies the color of the slider handles. */ + color?: string; + /** Specifies the opacity of the slider handles. */ + opacity?: number; + /** Specifies the width of the slider handles. */ + width?: number; + }; + /** Defines the options of the range selector slider markers. */ + sliderMarker?: { + /** Specifies the color of the slider markers. */ + color?: string; + /** Specifies a callback function that returns the text to be displayed by slider markers. */ + customizeText?: (scaleValue: { value: any; valueText: any; }) => string; + /** Specifies font options for the text displayed by the range selector slider markers. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in slider markers. */ + format?: string; + /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ + invalidRangeColor?: string; + /** + * Specifies the empty space between the marker's border and the marker’s text. + * @deprecated Use the 'paddingTopBottom' and 'paddingLeftRight' options instead + */ + padding?: number; + /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ + paddingTopBottom?: number; + /** Specifies the empty space between the marker's left and right borders and the marker's text. */ + paddingLeftRight?: number; + /** Specifies the placeholder height of the slider marker. */ + placeholderHeight?: number; + /** + * Specifies in pixels the height and width of the space reserved for the range selector slider markers. + * @deprecated Use the 'placeholderHeight' and 'indent' options instead + */ + placeholderSize?: { + /** Specifies the height of the placeholder for the left and right slider markers. */ + height?: number; + /** Specifies the width of the placeholder for the left and right slider markers. */ + width?: { + /** Specifies the width of the left slider marker's placeholder. */ + left?: number; + /** Specifies the width of the right slider marker's placeholder. */ + right?: number; + }; + }; + /** Specifies a precision for the formatted value displayed in slider markers. */ + precision?: number; + /** Indicates whether or not the slider markers are visible. */ + visible?: boolean; + }; + } + /** A widget that allows end users to select a range of values on a scale. */ + export class dxRangeSelector extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxRangeSelectorOptions); + constructor(element: Element, options?: dxRangeSelectorOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(skipChartAnimation?: boolean): void; + /** Returns the currently selected range. */ + getSelectedRange(): { startValue: any; endValue: any; }; + /** Sets a specified range. */ + setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; + } +} +interface JQuery { + dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; + dxRangeSelector(methodName: string, ...params: any[]): any; + dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; +} +declare module DevExpress.viz.map { + /** This section describes the fields and methods that can be used in code to manipulate the Area object. */ + export interface Area { + /** Contains the element type. */ + type: string; + /** Return the value of an attribute. */ + attribute(name: string): any; + /** Provides information about the selection state of an area. */ + selected(): boolean; + /** Sets a new selection state for an area. */ + selected(state: boolean): void; + /** Applies the area settings specified as a parameter and updates the area appearance. */ + applySettings(settings: any): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Markers object. */ + export interface Marker { + /** Contains the descriptive text accompanying the map marker. */ + text: string; + /** Contains the type of the element. */ + type: string; + /** Contains the URL of an image map marker. */ + url: string; + /** Contains the value of a bubble map marker. */ + value: number; + /** Contains the values of a pie map marker. */ + values: Array; + /** Returns the value of an attribute. */ + attribute(name: string): any; + /** Returns the coordinates of a specific marker. */ + coordinates(): Array; + /** Provides information about the selection state of a marker. */ + selected(): boolean; + /** Sets a new selection state for a marker. */ + selected(state: boolean): void; + /** Applies the marker settings specified as a parameter and updates the marker appearance. */ + applySettings(settings: any): void; + } + export interface AreaSettings { + /** Specifies the width of the area border in pixels. */ + borderWidth?: number; + /** Specifies a color for the area border. */ + borderColor?: string; + click?: any; + /** Specifies a color for an area. */ + color?: string; + /** Specifies the function that customizes each area individually. */ + customize?: (areaInfo: Area) => AreaSettings; + /** Specifies a color for the area border when the area is hovered over. */ + hoveredBorderColor?: string; + /** Specifies the pixel-measured width of the area border when the area is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for an area when this area is hovered over. */ + hoveredColor?: string; + /** Specifies whether or not to change the appearance of an area when it is hovered over. */ + hoverEnabled?: boolean; + /** Configures area labels. */ + label?: { + /** Specifies the data field that provides data for area labels. */ + dataField?: string; + /** Enables area labels. */ + enabled?: boolean; + /** Specifies font options for area labels. */ + font?: viz.core.Font; + }; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a map. */ + palette?: any; + /** Specifies the number of colors in a palette. */ + paletteSize?: number; + /** Allows you to paint areas with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring areas. */ + colorGroupingField?: string; + /** Specifies a color for the area border when the area is selected. */ + selectedBorderColor?: string; + /** Specifies a color for an area when this area is selected. */ + selectedColor?: string; + /** Specifies the pixel-measured width of the area border when the area is selected. */ + selectedBorderWidth?: number; + selectionChanged?: (area: Area) => void; + /** Specifies whether single or multiple areas can be selected on a vector map. */ + selectionMode?: string; + } + export interface MarkerSettings { + /** Specifies a color for the marker border. */ + borderColor?: string; + /** Specifies the width of the marker border in pixels. */ + borderWidth?: number; + click?: any; + /** Specifies a color for a marker of the dot or bubble type. */ + color?: string; + /** Specifies the function that customizes each marker individually. */ + customize?: (markerInfo: Marker) => MarkerSettings; + font?: Object; + /** Specifies the pixel-measured width of the marker border when the marker is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for the marker border when the marker is hovered over. */ + hoveredBorderColor?: string; + /** Specifies a color for a marker of the dot or bubble type when this marker is hovered over. */ + hoveredColor?: string; + /** Specifies whether or not to change the appearance of a marker when it is hovered over. */ + hoverEnabled?: boolean; + /** Specifies marker label options. */ + label?: { + /** Enables marker labels. */ + enabled?: boolean; + /** Specifies font options for marker labels. */ + font?: viz.core.Font; + }; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. */ + maxSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. */ + minSize?: number; + /** Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. */ + opacity?: number; + /** Specifies the pixel-measured width of the marker border when the marker is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the marker border when the marker is selected. */ + selectedBorderColor?: string; + /** Specifies a color for a marker of the dot or bubble type when this marker is selected. */ + selectedColor?: string; + selectionChanged?: (marker: Marker) => void; + /** Specifies whether a single or multiple markers can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. */ + size?: number; + /** Specifies the type of markers to be used on the map. */ + type?: string; + /** Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. */ + palette?: any; + /** Allows you to paint markers with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring markers. */ + colorGroupingField?: string; + /** Allows you to display bubbles with similar attributes in the same size. */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. */ + sizeGroupingField?: string; + } + export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { + /** An object specifying options for the map areas. */ + areaSettings?: AreaSettings; + /** Specifies the options for the map background. */ + background?: { + /** Specifies a color for the background border. */ + borderColor?: string; + /** Specifies a color for the background. */ + color?: string; + }; + /** Specifies the positioning of a map in geographical coordinates. */ + bounds?: Array; + /** Specifies the options of the control bar. */ + controlBar?: { + /** Specifies a color for the outline of the control bar elements. */ + borderColor?: string; + /** Specifies a color for the inner area of the control bar elements. */ + color?: string; + /** Specifies whether or not to display the control bar. */ + enabled?: boolean; + /** Specifies the margin of the control bar in pixels. */ + margin?: number; + /** Specifies the position of the control bar. */ + horizontalAlignment?: string; + /** Specifies the position of the control bar. */ + verticalAlignment?: string; + /** Specifies the opacity of the Control_Bar. */ + opacity?: number; + }; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies a data source for the map area. */ + mapData?: any; + /** Specifies a data source for the map markers. */ + markers?: any; + /** An object specifying options for the map markers. */ + markerSettings?: MarkerSettings; + /** Specifies the size of the dxVectorMap widget. */ + size?: viz.core.Size; + /** Specifies tooltip options. */ + tooltip?: viz.core.Tooltip; + /** Configures map legends. */ + legends?: Array; + /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ + wheelEnabled?: boolean; + /** Specifies whether the map should respond to touch gestures. */ + touchEnabled?: boolean; + /** Disables the zooming capability. */ + zoomingEnabled?: boolean; + /** Specifies the geographical coordinates of the center for a map. */ + center?: Array; + centerChanged?: (center: Array) => void; + /** A handler for the centerChanged event. */ + onCenterChanged?: (e: { + center: Array; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** Specifies a number that is used to zoom a map initially. */ + zoomFactor?: number; + /** Specifies a map's maximum zoom factor. */ + maxZoomFactor?: number; + zoomFactorChanged?: (zoomFactor: number) => void; + /** A handler for the zoomFactorChanged event. */ + onZoomFactorChanged?: (e: { + zoomFactor: number; + component: dxVectorMap; + element: Element; + }) => void; + click?: any; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the areaClick event. */ + onAreaClick?: any; + /** A handler for the areaSelectionChanged event. */ + onAreaSelectionChanged?: (e: { + target: Area; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the markerClick event. */ + onMarkerClick?: any; + /** A handler for the markerSelectionChanged event. */ + onMarkerSelectionChanged?: (e: { + target: Marker; + component: dxVectorMap; + element: Element; + }) => void; + /** Disables the panning capability. */ + panningEnabled?: boolean; + } + export interface Legend extends viz.core.BaseLegend { + /** Specifies text for legend items. */ + customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ + customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; + /** Specifies the source of data for the legend. */ + source?: string; + } + /** A vector map widget. */ + export class dxVectorMap extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxVectorMapOptions); + constructor(element: Element, options?: dxVectorMapOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Gets the current coordinates of the map center. */ + center(): Array; + /** Sets the coordinates of the map center. */ + center(centerCoordinates: Array): void; + /** Deselects all the selected areas on a map. The areas are displayed in their initial style after. */ + clearAreaSelection(): void; + /** Deselects all the selected markers on a map. The markers are displayed in their initial style after. */ + clearMarkerSelection(): void; + /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ + clearSelection(): void; + /** Converts client area coordinates into map coordinates. */ + convertCoordinates(x: number, y: number): Array; + /** Returns an array with all the map areas. */ + getAreas(): Array; + /** Returns an array with all the map markers. */ + getMarkers(): Array; + /** Gets the current coordinates of the map viewport. */ + viewport(): Array; + /** Sets the coordinates of the map viewport. */ + viewport(viewportCoordinates: Array): void; + /** Gets the current value of the map zoom factor. */ + zoomFactor(): number; + /** Sets the value of the map zoom factor. */ + zoomFactor(zoomFactor: number): void; + } +} +interface JQuery { + dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; + dxVectorMap(methodName: string, ...params: any[]): any; + dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; +} +declare module DevExpress.viz.sparklines { + export interface SparklineTooltip extends viz.core.Tooltip { + /** + * Specifies how a tooltip is horizontally aligned relative to the graph. + * @deprecated Tooltip alignment is no more available. + */ + horizontalAlignment?: string; + /** + * Specifies how a tooltip is vertically aligned relative to the graph. + * @deprecated Tooltip alignment is no more available. + */ + verticalAlignment?: string; + } + export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions { + /** Specifies the blank space between the widget's extreme elements and the boundaries of the area provided for the widget in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of the widget. */ + size?: viz.core.Size; + /** Specifies tooltip options. */ + tooltip?: SparklineTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + } + /** Overridden by descriptions for particular widgets. */ + export class BaseSparkline extends viz.core.BaseWidget { + /** Redraws a widget. */ + render(): void; + } + export interface dxBulletOptions extends BaseSparkline { + /** Specifies a color for the bullet bar. */ + color?: string; + /** Specifies an end value for the invisible scale. */ + endScaleValue?: number; + /** Specifies whether or not to show the target line. */ + showTarget?: boolean; + /** Specifies whether or not to show the line indicating zero on the invisible scale. */ + showZeroLevel?: boolean; + /** Specifies a start value for the invisible scale. */ + startScaleValue?: number; + /** Specifies the value indicated by the target line. */ + target?: number; + /** Specifies a color for both the target and zero level lines. */ + targetColor?: string; + /** Specifies the width of the target line. */ + targetWidth?: number; + /** Specifies the primary value indicated by the bullet bar. */ + value?: number; + } + /** A bullet graph widget. */ + export class dxBullet extends BaseSparkline { + constructor(element: JQuery, options?: dxBulletOptions); + constructor(element: Element, options?: dxBulletOptions); + } + export interface dxSparklineOptions extends BaseSparklineOptions { + /** Specifies the data source field that provides arguments for a sparkline. */ + argumentField?: string; + /** Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ + barNegativeColor?: string; + /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ + barPositiveColor?: string; + /** Specifies a data source for the sparkline. */ + dataSource?: Array; + /** Sets a color for the boundary of both the first and last points on a sparkline. */ + firstLastColor?: string; + /** Specifies whether a sparkline ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineColor?: string; + /** Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineWidth?: number; + /** Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ + lossColor?: string; + /** Sets a color for the boundary of the maximum point on a sparkline. */ + maxColor?: string; + /** Sets a color for the boundary of the minimum point on a sparkline. */ + minColor?: string; + /** Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointColor?: string; + /** Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ + pointSize?: number; + /** Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointSymbol?: string; + /** Specifies whether or not to indicate both the first and last values on a sparkline. */ + showFirstLast?: boolean; + /** Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ + showMinMax?: boolean; + /** Determines the type of a sparkline. */ + type?: string; + /** Specifies the data source field that provides values for a sparkline. */ + valueField?: string; + /** Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ + winColor?: string; + /** Specifies a value that serves as a threshold for the sparkline of the winloss type. */ + winlossThreshold?: number; + /** Specifies the minimum value of the sparkline value axis. */ + minValue?: number; + /** Specifies the maximum value of the sparkline's value axis. */ + maxValue?: number; + } + /** A sparkline widget. */ + export class dxSparkline extends BaseSparkline { + constructor(element: JQuery, options?: dxSparklineOptions); + constructor(element: Element, options?: dxSparklineOptions); + } +} +interface JQuery { + dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; + dxBullet(methodName: string, ...params: any[]): any; + dxBullet(methodName: "instance"): DevExpress.viz.sparklines.dxBullet; + dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; + dxSparkline(methodName: string, ...params: any[]): any; + dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; +} \ No newline at end of file diff --git a/devextreme/devextreme.d.ts b/devextreme/devextreme.d.ts index 83e69504b..706b4bded 100644 --- a/devextreme/devextreme.d.ts +++ b/devextreme/devextreme.d.ts @@ -1,4 +1,4 @@ -// Type definitions for DevExtreme 15.1.8 +// Type definitions for DevExtreme 15.2.3 // Project: http://js.devexpress.com/ // Definitions by: DevExpress Inc. // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -69,9 +69,7 @@ declare module DevExpress { export function registerComponent(name: string, componentClass: Object): void; /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ export function registerComponent(name: string, namespace: Object, componentClass: Object): void; - /** Requests that the browser call a specified function to update animation before the next repaint. */ export function requestAnimationFrame(callback: Function): number; - /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ export function cancelAnimationFrame(requestID: number): void; /** Custom Knockout binding that links an HTML element with a specific action. */ export class Action { } @@ -128,6 +126,8 @@ declare module DevExpress { leave(elements: JQuery, animation: any): void; /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ start(config: Object): JQueryPromise; + /** Stops all started animations. */ + stop(): void; } export class AnimationPresetCollection { /** Resets all the changes made in the animation repository. */ @@ -163,8 +163,8 @@ declare module DevExpress { tablet?: boolean; /** Specifies an array with the major and minor versions of the device platform. */ version?: Array; - /** Indicates whether or not the device platform is Windows8. */ - win8?: boolean; + /** Indicates whether or not the device platform is Windows. */ + win?: boolean; /** Specifies a performance grade of the current device. */ grade?: string; } @@ -262,16 +262,6 @@ declare module DevExpress { errorDetails?: any; } export interface StoreOptions { - inserted?: (values: Object, key: any) => void; - inserting?: (values: Object) => void; - loaded?: (result: Array) => void; - loading?: (loadOptions: LoadOptions) => void; - modified?: () => void; - modifying?: () => void; - removed?: (key: any) => void; - removing?: (key: any) => void; - updated?: (key: any, values: Object) => void; - updating?: (key: any, values: Object) => void; /** A handler for the modified event. */ onModified?: () => void; /** A handler for the modifying event. */ @@ -310,16 +300,6 @@ declare module DevExpress { } /** The base class for all Stores. */ export class Store implements EventsMixin { - inserted: JQueryCallback; - inserting: JQueryCallback; - loaded: JQueryCallback; - loading: JQueryCallback; - modified: JQueryCallback; - modifying: JQueryCallback; - removed: JQueryCallback; - removing: JQueryCallback; - updated: JQueryCallback; - updating: JQueryCallback; constructor(options?: StoreOptions); /** Returns the data item specified by the key. */ byKey(key: any): JQueryPromise; @@ -450,9 +430,6 @@ declare module DevExpress { /** An object that provides access to a data web service or local data storage for collection container widgets. */ export class DataSource implements EventsMixin { constructor(options?: DataSourceOptions); - changed: JQueryCallback; - loadError: JQueryCallback; - loadingChanged: JQueryCallback; /** Disposes all resources associated with this DataSource. */ dispose(): void; /** Returns the current filter option value. */ @@ -583,6 +560,7 @@ declare module DevExpress { /** A function used to customize a web request before it is sent. */ beforeSend?: (request: { url: string; + async: boolean; method: string; timeout: number; params: Object; @@ -593,6 +571,8 @@ declare module DevExpress { jsonp?: boolean; /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ keyType?: any; + /** Specifies whether or not dates found in the response are deserialized. */ + deserializeDates?: boolean; /** Specifies the URL of the data service being accessed via the current ODataContext. */ url?: string; /** Specifies the version of the OData protocol used to interact with the data service. */ @@ -714,26 +694,16 @@ declare module DevExpress { export interface CollectionWidgetOptions extends WidgetOptions { /** A data source used to fetch data to be displayed by the widget. */ dataSource?: any; - itemClickAction?: any; - itemHoldAction?: Function; /** The time period in milliseconds before the onItemHold event is raised. */ itemHoldTimeout?: number; - itemRender?: any; - itemRenderedAction?: Function; /** An array of items displayed by the widget. */ items?: Array; - /** - * A function performed when a widget item is selected. - * @deprecated onSelectionChanged.md - */ - itemSelectAction?: Function; /** The template to be used for rendering items. */ itemTemplate?: any; loopItemFocus?: boolean; /** The text or HTML markup displayed by the widget if the item collection is empty. */ noDataText?: string; onContentReady?: any; - contentReadyAction?: any; /** A handler for the itemClick event. */ onItemClick?: any; /** A handler for the itemContextMenu event. */ @@ -774,7 +744,6 @@ declare module DevExpress { displayExpr?: any; /** Specifies the name of a data source item field whose value is held in the value configuration option. */ valueExpr?: any; - itemRender?: any; /** An array of items displayed by the widget. */ items?: Array; /** The template to be used for rendering items. */ @@ -787,7 +756,6 @@ declare module DevExpress { value?: Object; /** A handler for the valueChanged event. */ onValueChanged?: Function; - valueChangeAction?: Function; /** A Boolean value specifying whether or not the widget is read-only. */ readOnly?: boolean; /** Holds the object that defines the error that occurred during validation. */ @@ -835,6 +803,10 @@ declare module DevExpress { export var utils: { /** Sets parameters for the viewport meta tag. */ initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + cancelAnimationFrame(requestID: number): void; }; /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ export module viz { @@ -927,6 +899,8 @@ declare module DevExpress.ui { displayValue?: string; /** The minimum number of characters that must be entered into the text box to begin a search. */ minSearchLength?: number; + /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ + showDataBeforeSearch?: boolean; /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ searchExpr?: Object; /** Specifies the binary operation used to filter data. */ @@ -958,7 +932,6 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxDropDownListOptions); } export interface dxToolbarOptions extends CollectionWidgetOptions { - menuItemRender?: any; /** The template used to render menu items. */ menuItemTemplate?: any; /** Informs the widget about its location in a view HTML markup. */ @@ -982,6 +955,10 @@ declare module DevExpress.ui { type?: string; width?: any; closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ + closeOnSwipe?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ + closeOnClick?: boolean; } /** The toast message widget. */ export class dxToast extends dxOverlay { @@ -991,37 +968,26 @@ declare module DevExpress.ui { export interface dxTextEditorOptions extends EditorOptions { /** A handler for the change event. */ onChange?: Function; - changeAction?: Function; /** A handler for the copy event. */ onCopy?: Function; - copyAction?: Function; /** A handler for the cut event. */ onCut?: Function; - cutAction?: Function; /** A handler for the enterKey event. */ onEnterKey?: Function; - enterKeyAction?: Function; /** A handler for the focusIn event. */ onFocusIn?: Function; - focusInAction?: Function; /** A handler for the focusOut event. */ onFocusOut?: Function; - focusOutAction?: Function; /** A handler for the input event. */ onInput?: Function; - inputAction?: Function; /** A handler for the keyDown event. */ onKeyDown?: Function; - keyDownAction?: Function; /** A handler for the keyPress event. */ onKeyPress?: Function; - keyPressAction?: Function; /** A handler for the keyUp event. */ onKeyUp?: Function; - keyUpAction?: Function; /** A handler for the paste event. */ onPaste?: Function; - pasteAction?: Function; /** The text displayed by the widget when the widget value is empty. */ placeholder?: string; /** Specifies whether to display the Clear button in the widget. */ @@ -1036,9 +1002,7 @@ declare module DevExpress.ui { attr?: Object; /** The read-only option that holds the text displayed by the widget input element. */ text?: string; - /** Specifies whether or not the widget supports the focused state and keyboard navigation. */ focusStateEnabled?: boolean; - /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ hoverStateEnabled?: boolean; /** The editor mask that specifies the format of the entered string. */ mask?: string; @@ -1048,6 +1012,8 @@ declare module DevExpress.ui { maskRules?: Object; /** A message displayed when the entered text does not match the specified pattern. */ maskInvalidMessage?: string; + /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ + useMaskedValue?: boolean; } /** A base class for text editing widgets. */ export class dxTextEditor extends Editor { @@ -1100,9 +1066,14 @@ declare module DevExpress.ui { onTitleHold?: Function; /** A handler for the titleRendered event. */ onTitleRendered?: Function; - titleTemplate?: any; /** The template to be used for rendering an item title. */ itemTitleTemplate?: any; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether to enable or disable scrolling. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; } /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ export class dxTabPanel extends dxMultiView { @@ -1110,6 +1081,8 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxTabPanelOptions); } export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; /** The template to be used for rendering the widget text field. */ fieldTemplate?: any; /** The text that is provided as a hint in the select box editor. */ @@ -1125,6 +1098,8 @@ declare module DevExpress.ui { export interface dxTagBoxOptions extends dxSelectBoxOptions { /** Holds the list of selected values. */ values?: Array; + /** A read-only option that holds the last selected value. */ + value?: Object; } /** A widget that allows you to select multiple items from a dropdown list. */ export class dxTagBox extends dxSelectBox { @@ -1134,14 +1109,12 @@ declare module DevExpress.ui { export interface dxScrollViewOptions extends dxScrollableOptions { /** A handler for the pullDown event. */ onPullDown?: Function; - pullDownAction?: Function; /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ pulledDownText?: string; /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ pullingDownText?: string; /** A handler for the reachBottom event. */ onReachBottom?: Function; - reachBottomAction?: Function; /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ reachBottomText?: string; /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ @@ -1171,12 +1144,10 @@ declare module DevExpress.ui { disabled?: boolean; /** A handler for the scroll event. */ onScroll?: Function; - scrollAction?: Function; /** Specifies when the widget shows the scrollbar. */ showScrollbar?: string; /** A handler for the update event. */ onUpdated?: Function; - updateAction?: Function; /** Indicates whether to use native or simulated scrolling. */ useNative?: boolean; /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ @@ -1220,6 +1191,7 @@ declare module DevExpress.ui { update(): void; } export interface dxRadioGroupOptions extends CollectionWidgetOptions, DataExpressionMixinOptions { + activeStateEnabled?: boolean; /** Specifies the radio group layout. */ layout?: string; } @@ -1293,12 +1265,24 @@ declare module DevExpress.ui { resizeEnabled?: boolean; /** The height of the widget in pixels. */ height?: any; + /** Specifies the maximum height the widget can reach while resizing. */ + maxHeight?: any; + /** Specifies the maximum width the widget can reach while resizing. */ + maxWidth?: any; + /** Specifies the minimum height the widget can reach while resizing. */ + minHeight?: any; + /** Specifies the minimum width the widget can reach while resizing. */ + minWidth?: any; /** A handler for the hidden event. */ onHidden?: Function; - hiddenAction?: Function; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; /** A handler for the hiding event. */ onHiding?: Function; - hidingAction?: Function; /** An object defining widget positioning options. */ position?: PositionOptions; /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ @@ -1307,10 +1291,8 @@ declare module DevExpress.ui { shadingColor?: string; /** A handler for the showing event. */ onShowing?: Function; - showingAction?: Function; /** A handler for the shown event. */ onShown?: Function; - shownAction?: Function; /** A Boolean value specifying whether or not the widget is visible. */ visible?: boolean; /** The widget width in pixels. */ @@ -1379,7 +1361,6 @@ declare module DevExpress.ui { export interface dxMapOptions extends WidgetOptions { /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route. */ autoAdjust?: boolean; - /** An object, a string, or an array specifying the location displayed at the center of the widget. */ center?: { /** The latitude location displayed in the center of the widget. */ lat?: number; @@ -1388,7 +1369,6 @@ declare module DevExpress.ui { }; /** A handler for the click event. */ onClick?: any; - clickAction?: any; /** Specifies whether or not map widget controls are available. */ controls?: boolean; /** Specifies the height of the widget. */ @@ -1404,25 +1384,20 @@ declare module DevExpress.ui { } /** A handler for the markerAdded event. */ onMarkerAdded?: Function; - markerAddedAction?: Function; /** A URL pointing to the custom icon to be used for map markers. */ markerIconSrc?: string; /** A handler for the markerRemoved event. */ onMarkerRemoved?: Function; - markerRemovedAction?: Function; /** An array of markers displayed on a map. */ markers?: Array; /** The name of the current map data provider. */ provider?: string; /** A handler for the ready event. */ onReady?: Function; - readyAction?: Function; /** A handler for the routeAdded event. */ onRouteAdded?: Function; - routeAddedAction?: Function; /** A handler for the routeRemoved event. */ onRouteRemoved?: Function; - routeRemovedAction?: Function; /** An array of routes shown on the map. */ routes?: Array; /** The type of a map to display. */ @@ -1463,7 +1438,6 @@ declare module DevExpress.ui { focusStateEnabled?: boolean; /** A Boolean value specifying whether or not to group widget items. */ grouped?: boolean; - groupRender?: any; /** The name of the template used to display a group header. */ groupTemplate?: any; /** The text displayed on the button used to load the next page from the data source. */ @@ -1472,7 +1446,6 @@ declare module DevExpress.ui { onPageLoading?: Function; /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ pageLoadMode?: string; - pageLoadingAction?: Function; /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ pageLoadingText?: string; /** The text displayed by the widget when nothing is selected. */ @@ -1489,14 +1462,12 @@ declare module DevExpress.ui { pullingDownText?: string; /** A handler for the pullRefresh event. */ onPullRefresh?: Function; - pullRefreshAction?: Function; /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ pullRefreshEnabled?: boolean; /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ refreshingText?: string; /** A handler for the scroll event. */ onScroll?: Function; - scrollAction?: Function; /** A Boolean value specifying whether or not the search bar is visible. */ searchEnabled?: boolean; /** The text that is provided as a hint in the lookup's search bar. */ @@ -1520,8 +1491,6 @@ declare module DevExpress.ui { usePopover?: boolean; /** A handler for the valueChanged event. */ onValueChanged?: Function; - contentReadyAction?: Function; - titleRender?: any; /** A handler for the titleRendered event. */ onTitleRendered?: Function; /** A Boolean value specifying whether or not to display the title in the popup window. */ @@ -1568,7 +1537,6 @@ declare module DevExpress.ui { export interface dxListOptions extends CollectionWidgetOptions { /** A Boolean value specifying whether or not to display a grouped list. */ grouped?: boolean; - groupRender?: any; /** The template to be used for rendering item groups. */ groupTemplate?: any; onItemDeleting?: Function; @@ -1576,20 +1544,16 @@ declare module DevExpress.ui { onItemDeleted?: Function; /** A handler for the groupRendered event. */ onGroupRendered?: Function; - itemDeleteAction?: Function; /** A handler for the itemReordered event. */ onItemReordered?: Function; - itemReorderAction?: Function; /** A handler for the itemClick event. */ onItemClick?: any; /** A handler for the itemSwipe event. */ onItemSwipe?: Function; - itemSwipeAction?: Function; /** The text displayed on the button used to load the next page from the data source. */ nextButtonText?: string; /** A handler for the pageLoading event. */ onPageLoading?: Function; - pageLoadingAction?: Function; /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ pageLoadingText?: string; /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ @@ -1598,14 +1562,12 @@ declare module DevExpress.ui { pullingDownText?: string; /** A handler for the pullRefresh event. */ onPullRefresh?: Function; - pullRefreshAction?: Function; /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ pullRefreshEnabled?: boolean; /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ refreshingText?: string; /** A handler for the scroll event. */ onScroll?: Function; - scrollAction?: Function; /** A Boolean value specifying whether to enable or disable list scrolling. */ scrollingEnabled?: boolean; /** Specifies when the widget shows the scrollbar. */ @@ -1618,7 +1580,6 @@ declare module DevExpress.ui { scrollByContent?: boolean; /** A Boolean value specifying if the list is scrolled using the scrollbar. */ scrollByThumb?: boolean; - itemUnselectAction?: Function; onItemContextMenu?: Function; onItemHold?: Function; /** Specifies whether or not an end-user can collapse groups. */ @@ -1630,6 +1591,7 @@ declare module DevExpress.ui { /** Specifies item selection mode. */ selectionMode?: string; selectAllText?: string; + onSelectAllChanged?: Function; /** Specifies the array of items for a context menu called for a list item. */ menuItems?: Array; /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ @@ -1737,17 +1699,13 @@ declare module DevExpress.ui { onOpened?: Function; /** Specifies whether or not the drop-down editor is displayed. */ opened?: boolean; - closeAction?: Function; - openAction?: Function; - shownAction?: Function; - hiddenAction?: Function; /** Specifies whether or not the widget allows an end-user to enter a custom value. */ fieldEditEnabled?: boolean; - editEnabled?: boolean; /** Specifies the way an end-user applies the selected value. */ applyValueMode?: string; /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ deferRendering?: boolean; + activeStateEnabled?: boolean; } /** A drop-down editor widget. */ export class dxDropDownEditor extends dxTextBox { @@ -1791,10 +1749,14 @@ declare module DevExpress.ui { interval?: number; /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ maxZoomLevel?: string; - /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ minZoomLevel?: string; /** Specifies the type of date/time picker. */ pickerType?: string; + /** Specifies the message displayed if the typed value is not a valid date or time. */ + invalidDateMessage?: string; + /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ + dateOutOfRangeMessage?: string; } /** A date box widget. */ export class dxDateBox extends dxDropDownEditor { @@ -1802,6 +1764,7 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxDateBoxOptions); } export interface dxCheckBoxOptions extends EditorOptions { + activeStateEnabled?: boolean; /** Specifies the widget state. */ value?: boolean; /** Specifies the text displayed by the check box. */ @@ -1813,6 +1776,7 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxCheckBoxOptions); } export interface dxCalendarOptions extends EditorOptions { + activeStateEnabled?: boolean; /** Specifies a date displayed on the current calendar page. */ currentDate?: Date; /** Specifies the first day of a week. */ @@ -1829,8 +1793,8 @@ declare module DevExpress.ui { maxZoomLevel?: string; /** Specifies the minimum zoom level of the calendar. */ minZoomLevel?: string; - /** The template to be used for rendering calendar cells. */ - cellTemplate?: any; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; } /** A calendar widget. */ export class dxCalendar extends Editor { @@ -1842,7 +1806,6 @@ declare module DevExpress.ui { activeStateEnabled?: boolean; /** A handler for the click event. */ onClick?: any; - clickAction?: any; /** Specifies the icon to be displayed on the button. */ icon?: string; iconSrc?: string; @@ -2015,6 +1978,7 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxProgressBarOptions); } export interface dxSliderOptions extends dxTrackBarOptions { + activeStateEnabled?: boolean; /** The slider step size. */ step?: number; /** The current slider value. */ @@ -2060,6 +2024,135 @@ declare module DevExpress.ui { constructor(element: JQuery, options?: dxRangeSliderOptions); constructor(element: Element, options?: dxRangeSliderOptions); } + export interface dxFormItemLabel { + /** Specifies the label text. */ + text?: string; + /** Specifies whether or not the label is visible. */ + visible?: boolean; + /** Specifies whether or not a colon is displayed at the end of the current label. */ + showColon?: boolean; + /** Specifies the location of a label against the editor. */ + location?: string; + /** Specifies the label horizontal alignment. */ + alignment?: string; + } + export interface dxFormItem { + /** Specifies the type of the current item. */ + itemType?: string; + /** Specifies whether or not the current form item is visible. */ + visible?: boolean; + /** Specifies the sequence number of the item in a form, group or tab. */ + visibleIndex?: number; + /** Specifies a CSS class to be applied to the form item. */ + cssClass?: string; + /** Specifies the number of columns spanned by the item. */ + colSpan?: number; + } + export interface dxFormSimpleItem extends dxFormItem { + /** Specifies the path to the formData object field bound to the current form item. */ + dataField?: string; + /** Specifies the form item name. */ + name?: string; + /** Specifie which editor widget is used to display and edit the form item value. */ + editorType?: string; + /** Specifies configuration options for the editor widget of the current form item. */ + editorOptions?: Object; + /** A template to be used for rendering the form item. */ + template?: any; + /** Specifies the help text displayed for the current form item. */ + helpText?: string; + /** Specifies whether the current form item is required. */ + isRequired?: boolean; + /** Specifies options for the form item label. */ + label?: dxFormItemLabel; + /** An array of validation rules to be checked for the form item editor. */ + validationRules?: Array; + } + export interface dxFormGroupItem extends dxFormItem { + /** Specifies the group caption. */ + caption?: string; + /** A template to be used for rendering the group item. */ + template?: any; + /** The count of columns in the group layout. */ + colCount?: number; + /** Specifies whether or not all group item labels are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the group. */ + items?: Array; + } + export interface dxFormTab { + /** Specifies the tab title. */ + title?: string; + /** The count of columns in the tab layout. */ + colCount?: number; + /** Specifies whether or not labels of items displayed within the current tab are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the tab. */ + items?: Array; + } + export interface dxFormTabbedItem extends dxFormItem { + /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + tabPanelOptions?: Object; + /** An array of tab configuration objects. */ + tabs?: Array; + } + export interface dxFormOptions extends WidgetOptions { + /** An object providing data for the form. */ + formData?: Object; + /** The count of columns in the form layout. */ + colCount?: any; + /** Specifies the location of a label against the editor. */ + labelLocation?: string; + /** Specifies whether or not all editors on the form are read-only. */ + readOnly?: boolean; + /** A handler for the fieldDataChanged event. */ + onFieldDataChanged?: (e: Object) => void; + /** A handler for the editorEnterKey event. */ + onEditorEnterKey?: (e: Object) => void; + /** Specifies a function that customizes a form item after it has been created. */ + customizeItem?: Function; + /** The minimum column width used for calculating column count in the form layout. */ + minColWidth?: number; + /** Specifies whether or not all root item labels are aligned. */ + alignItemLabels?: boolean; + /** Specifies whether or not item labels in all groups are aligned. */ + alignItemLabelsInAllGroups?: boolean; + /** Specifies whether or not a colon is displayed at the end of form labels. */ + showColonAfterLabel?: boolean; + /** Specifies whether or not the required mark is displayed for optional fields. */ + showRequiredMark?: boolean; + /** Specifies whether or not the optional mark is displayed for optional fields. */ + showOptionalMark?: boolean; + /** The text displayed for required fields. */ + requiredMark?: string; + /** The text displayed for optional fields. */ + optionalMark?: string; + /** Specifies whether or not the total validation summary is displayed on the form. */ + showValidationSummary?: boolean; + /** Holds an array of form items. */ + items?: Array; + /** A Boolean value specifying whether to enable or disable form scrolling. */ + scrollingEnabled?: boolean; + } + /** A form widget used to display and edit values of object fields. */ + export class dxForm extends Widget { + constructor(element: JQuery, options?: dxFormOptions); + constructor(element: Element, options?: dxFormOptions); + /** Updates the specified field of the formData object and the corresponding editor on the form. */ + updateData(dataField: string, value: any): void; + /** Updates the specified fields of the formData object and the corresponding editors on the form. */ + updateData(data: Object): void; + /** Updates the value of a form item option. */ + itemOption(field: string, option: string, value: any): void; + /** Updates the values of form item options. */ + itemOption(field: string, options: Object): void; + /** Returns an editor instance associated with the specified formData field. */ + getEditor(field: string): Object; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ + validate(): Object; + } } interface JQuery { dxProgressBar(): JQuery; @@ -2276,6 +2369,11 @@ interface JQuery { dxAutocomplete(options: string): any; dxAutocomplete(options: string, ...params: any[]): any; dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxForm(): JQuery; + dxForm(options: "instance"): DevExpress.ui.dxForm; + dxForm(options: string): any; + dxForm(options: string, ...params: any[]): any; + dxForm(options: DevExpress.ui.dxForm): JQuery; } declare module DevExpress.ui { @@ -2286,6 +2384,8 @@ declare module DevExpress.ui { baseItemHeight?: number; /** Specifies the width of the base tile view item. */ baseItemWidth?: number; + /** Specifies whether tiles are placed horizontally or vertically. */ + direction?: string; /** Specifies the height of the widget. */ height?: any; /** Specifies the distance in pixels between adjacent tiles. */ @@ -2301,6 +2401,7 @@ declare module DevExpress.ui { scrollPosition(): number; } export interface dxSwitchOptions extends EditorOptions { + activeStateEnabled?: boolean; /** Text displayed when the widget is in a disabled state. */ offText?: string; /** Text displayed when the widget is in an enabled state. */ @@ -2314,6 +2415,8 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxSwitchOptions); } export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies the current menu position. */ + menuPosition?: string; /** Specifies whether or not the menu panel is visible. */ menuVisible?: boolean; /** Specifies whether or not the menu is shown when a user swipes the widget content. */ @@ -2343,10 +2446,10 @@ declare module DevExpress.ui { activeStateEnabled?: boolean; /** A Boolean value specifying whether or not to display a grouped menu. */ menuGrouped?: boolean; - menuGroupRender?: any; + /** Specifies the current menu position. */ + menuPosition?: string; /** The name of the template used to display a group header. */ menuGroupTemplate?: any; - menuItemRender?: any; /** The template used to render menu items. */ menuItemTemplate?: any; /** A handler for the menuGroupRendered event. */ @@ -2409,18 +2512,15 @@ declare module DevExpress.ui { export interface dxDropDownMenuOptions extends WidgetOptions { /** A handler for the buttonClick event. */ onButtonClick?: any; - buttonClickAction?: any; /** The name of the icon to be displayed by the DropDownMenu button. */ buttonIcon?: string; - buttonIconSrc?: string; /** The text displayed in the DropDownMenu button. */ buttonText?: string; + buttonIconSrc?: string; /** A data source used to fetch data to be displayed by the widget. */ dataSource?: any; /** A handler for the itemClick event. */ onItemClick?: any; - itemClickAction?: any; - itemRender?: any; /** An array of items displayed by the widget. */ items?: Array; /** The template to be used for rendering items. */ @@ -2433,7 +2533,6 @@ declare module DevExpress.ui { popupHeight?: any; /** Specifies whether or not the drop-down menu is displayed. */ opened?: boolean; - /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ hoverStateEnabled?: boolean; } /** A drop-down menu widget. */ @@ -2447,7 +2546,6 @@ declare module DevExpress.ui { close(): void; } export interface dxActionSheetOptions extends CollectionWidgetOptions { - cancelClickAction?: any; /** A handler for the cancelClick event. */ onCancelClick?: any; /** The text displayed in the button that closes the action sheet. */ @@ -2540,7 +2638,7 @@ declare module DevExpress.data { dataType?: string; /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ groupInterval?: any; - /** Specifies how to aggregate field data. Cannot be used for th XmlaStore store type. */ + /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ summaryType?: string; /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ calculateCustomSummary?: (options: { @@ -2594,18 +2692,60 @@ declare module DevExpress.data { allowExpandAll?: boolean; /** Specifies the absolute width of the field in the pivot grid. */ width?: number; + /** Specifies the summary post-processing algorithm. */ + summaryDisplayMode?: string; + /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ + runningTotal?: string; + /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ + allowCrossGroupCalculation?: boolean; + /** Specifies a callback function that allows you to modify summary values after they are calculated. */ + calculateSummaryValue?: (e: Object) => number; + /** Specifies whether or not to display Total values for the field. */ + showTotals?: boolean; + /** Specifies whether or not to display Grand Total values for the field. */ + showGrandTotals?: boolean; + } + export class SummaryCell { + /** Gets the parent cell in a specified direction. */ + parent(direction: string): SummaryCell; + /** Gets all children cells in a specified direction. */ + children(direction: string): Array; + /** Gets a partial Grand Total cell of a row or column. */ + grandTotal(direction: string): SummaryCell; + /** Gets the Grand Total of the entire pivot grid. */ + grandTotal(): SummaryCell; + /** Gets the cell next to the current one in a specified direction. */ + next(direction: string): SummaryCell; + /** Gets the cell next to current in a specified direction. */ + next(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the cell prior to the current one in a specified direction. */ + prev(direction: string): SummaryCell; + /** Gets the cell previous to current in a specified direction. */ + prev(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the child cell in a specified direction. */ + child(direction: string, fieldValue: any): SummaryCell; + /** Gets the cell located by the path of the source cell with one field value changed. */ + slice(field: PivotGridField, value: any): SummaryCell; + /** Gets the header cell of a row or column field to which the current cell belongs. */ + field(area: string): PivotGridField; + /** Gets the value of the current cell. */ + value(): any; + /** Gets the value of the current cell. */ + value(isCalculatedValue: boolean): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField, isCalculatedValue: boolean): any; } export interface PivotGridDataSourceOptions { /** Specifies the underlying Store instance used to access data. */ store?: any; /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ retrieveFields?: boolean; - /** Specifies data filtering conditions. */ + /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ filter?: Object; /** An array of pivot grid fields. */ fields?: Array; - /** Indicates whether or not the local sorting of the XMLA data should be performed. */ - localSorting?: boolean; /** A handler for the changed event. */ onChanged?: () => void; /** A handler for the loadingChanged event. */ @@ -2618,7 +2758,9 @@ declare module DevExpress.data { /** An object that provides access to data for the dxPivotGrid widget. */ export class PivotGridDataSource implements EventsMixin { constructor(options?: PivotGridDataSource); - /** Starts loading data. */ + /** Starts reloading data from any store and updating the data source. */ + reload(): JQueryPromise; + /** Starts updating the data source. Reloads data from the XMLA store only. */ load(): JQueryPromise; /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ isLoading(): boolean; @@ -2644,6 +2786,22 @@ declare module DevExpress.data { collapseAll(id: any): void; /** Disposes of all resources associated with this PivotGridDataSource. */ dispose(): void; + /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ + filter(): Object; + /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ + filter(filterExpr: Object): void; + /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ + createDrillDownDataSource(options: { + columnPath?: Array; + rowPath?: Array; + dataIndex?: number; + maxRowCount?: number; + customColumns?: Array; + }): DevExpress.data.DataSource; + /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ + state(): Object; + /** Sets the PivotGridDataSource state. */ + state(state: Object): void; on(eventName: string, eventHandler: Function): PivotGridDataSource; on(events: { [eventName: string]: Function; }): PivotGridDataSource; off(eventName: string): PivotGridDataSource; @@ -2666,6 +2824,8 @@ declare module DevExpress.ui { firstDayOfWeek?: number; /** The template to be used for rendering appointments. */ appointmentTemplate?: any; + /** The template to be used for rendering an appointment tooltip. */ + appointmentTooltipTemplate?: any; /** Lists the views to be available within the scheduler's View Selector. */ views?: Array; /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ @@ -2674,14 +2834,36 @@ declare module DevExpress.ui { startDayHour?: number; /** Specifies an end hour in the scheduler view's time interval. */ endDayHour?: number; - /** Specifies whether the scheduler data can be edited at runtime. */ - editing?: boolean; + /** Specifies whether or not the "All-day" panel is visible. */ + showAllDayPanel?: boolean; + /** Specifies cell duration in minutes. */ + cellDuration?: number; + /** Specifies the edit mode for recurrent appointments. */ + recurrenceEditMode?: string; + /** Specifies which editing operations an end-user can perform on appointments. */ + editing?: { + /** Specifies whether or not an end-user can add appointments. */ + allowAdding?: boolean; + /** Specifies whether or not an end-user can change appointment options. */ + allowUpdating?: boolean; + /** Specifies whether or not an end-user can delete appointments. */ + allowDeleting?: boolean; + /** Specifies whether or not an end-user can change an appointment duration. */ + allowResizing?: boolean; + /** Specifies whether or not an end-user can drag appointments. */ + allowDragging?: boolean; + } /** Specifies an array of resources available in the scheduler. */ resources?: Array<{ /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ allowMultiple?: boolean; - /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + /** + * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. + * @deprecated Use the 'useColorAsDefault' property instead + */ mainColor?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + useColorAsDefault?: boolean; /** A data source used to fetch resources to be available in the scheduler. */ dataSource?: any; /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ @@ -2707,6 +2889,18 @@ declare module DevExpress.ui { onAppointmentDeleted?: Function; /** A handler for the appointmentRendered event. */ onAppointmentRendered?: Function; + /** A handler for the appointmentClick event. */ + onAppointmentClick?: any; + /** A handler for the appointmentDblClick event. */ + onAppointmentDblClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the appointmentFormCreated event. */ + onAppointmentFormCreated?: Function; + /** Specifies whether or not an end-user can scroll the view horizontally. */ + horizontalScrollingEnabled?: boolean; + /** Specifies whether a user can switch views using tabs or a drop-down menu. */ + useDropDownViewSwitcher?: boolean; } /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ export class dxScheduler extends Widget { @@ -2720,6 +2914,8 @@ declare module DevExpress.ui { deleteAppointment(appointment: Object): void; /** Scrolls the scheduler work space to the specified time. */ scrollToTime(hours: number, minutes: number): void; + /** Displays the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean): void; } export interface dxColorBoxOptions extends dxDropDownEditorOptions { /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ @@ -2737,55 +2933,53 @@ declare module DevExpress.ui { constructor(element: JQuery, options?: dxColorBoxOptions); constructor(element: Element, options?: dxColorBoxOptions); } - export interface dxColorPickerOptions extends dxColorBoxOptions { } - /** - * A widget used to specify a color value. - * @deprecated Use the dxColorBox widget instead - */ - export class dxColorPicker extends dxColorBox { - constructor(element: JQuery, options?: dxColorPickerOptions); - constructor(element: Element, options?: dxColorPickerOptions); + export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ + disabledExpr?: any; + /** Specifies the name of the data source item field that holds the key of the parent item. */ + parentIdExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is expanded. */ + expandedExpr?: any; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; } - export interface dxTreeViewOptions extends CollectionWidgetOptions { + export class HierarchicalCollectionWidget extends CollectionWidget { + } + export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { /** Specifies whether or not to animate item collapsing and expanding. */ animationEnabled?: boolean; /** Specifies whether a nested or plain array is used as a data source. */ dataStructure?: string; /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ expandAllEnabled?: boolean; - /** - * An array of currently expanded item objects. - * @deprecated Use item.expanded field instead - */ - expandedItems?: Array; /** Specifies whether or not a check box is displayed at each tree view item. */ showCheckBoxes?: boolean; + /** Specifies the current check boxes display mode. */ + showCheckBoxesMode?: string; /** Specifies whether or not to select nodes recursively. */ selectNodesRecursive?: boolean; + /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ + expandNodesRecursive?: boolean; /** Specifies whether the "Select All" check box is displayed over the tree view. */ selectAllEnabled?: boolean; /** Specifies the text displayed at the "Select All" check box. */ selectAllText?: string; - /** Specifies the name of the data source item field used as a key. */ - keyExpr?: any; - /** Specifies the name of the data source item field whose value is displayed by the widget. */ - displayExpr?: any; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding node is selected. */ - selectedExpr?: any; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding node is expanded. */ - expandedExpr?: any; - /** Specifies the name of the data source item field that contains an array of nested items. */ - itemsExpr?: any; - /** Specifies the name of the data source item field that holds the key of the parent item. */ - parentIdExpr?: any; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding node is disabled. */ - disabledExpr?: any; /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ hasItemsExpr?: any; /** Specifies if the virtual mode is enabled. */ virtualModeEnabled?: boolean; /** Specifies the parent ID value of the root item. */ rootValue?: any; + /** Specifies the current value used to filter tree view items. */ + searchValue?: string; /** A string value specifying available scrolling directions. */ scrollDirection?: string; /** A handler for the itemSelected event. */ @@ -2798,11 +2992,9 @@ declare module DevExpress.ui { onItemContextMenu?: Function; onItemRendered?: Function; onItemHold?: Function; - hoverStateEnabled?: boolean; - focusStateEnabled?: boolean; } /** A widget displaying specified data items as a tree. */ - export class dxTreeView extends CollectionWidget { + export class dxTreeView extends HierarchicalCollectionWidget { constructor(element: JQuery, options?: dxTreeViewOptions); constructor(element: Element, options?: dxTreeViewOptions); /** Updates the tree view scrollbars according to the current size of the widget content. */ @@ -2822,7 +3014,7 @@ declare module DevExpress.ui { /** Unselects all widget items. */ unselectAll(): void; } - export interface dxMenuBaseOptions extends CollectionWidgetOptions { + export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { /** An object that defines the animation options of the widget. */ animation?: fx.AnimationOptions; /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ @@ -2847,10 +3039,8 @@ declare module DevExpress.ui { hide?: number; }; }; - /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ - hoverStateEnabled?: boolean; } - export class dxMenuBase extends CollectionWidget { + export class dxMenuBase extends HierarchicalCollectionWidget { constructor(element: JQuery, options?: dxMenuBaseOptions); constructor(element: Element, options?: dxMenuBaseOptions); /** Selects the specified item. */ @@ -2879,16 +3069,12 @@ declare module DevExpress.ui { submenuDirection?: string; /** A handler for the submenuHidden event. */ onSubmenuHidden?: Function; - submenuHiddenAction?: Function; /** A handler for the submenuHiding event. */ onSubmenuHiding?: Function; - submenuHidingAction?: Function; /** A handler for the submenuShowing event. */ onSubmenuShowing?: Function; - submenuShowingAction?: Function; /** A handler for the submenuShown event. */ onSubmenuShown?: Function; - submenuShownAction?: Function; } /** A menu widget. */ export class dxMenu extends dxMenuBase { @@ -2940,6 +3126,10 @@ declare module DevExpress.ui { paging?: boolean; /** Specifies whether or not sorting must be performed on the server side. */ sorting?: boolean; + /** Specifies whether or not grouping must be performed on the server side. */ + grouping?: boolean; + /** Specifies whether or not summaries calculation must be performed on the server side. */ + summary?: boolean; } export interface dxDataGridColumn { /** Specifies the content alignment within column cells. */ @@ -2948,6 +3138,8 @@ declare module DevExpress.ui { allowEditing?: boolean; /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ allowFiltering?: boolean; + /** Specifies whether or not to allow filtering by this column using its header. */ + allowHeaderFiltering?: boolean; /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ allowFixing?: boolean; /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ @@ -2966,14 +3158,18 @@ declare module DevExpress.ui { autoExpandGroup?: boolean; /** Specifies a callback function that returns a value to be displayed in a column cell. */ calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ + setCellValue?: (rowData: Object, value: any) => void; /** Specifies a callback function that defines filters for customary calculated grid cells. */ - calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string) => Array; + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; /** Specifies a caption for a column. */ caption?: string; /** Specifies a custom template for grid column cells. */ cellTemplate?: any; /** Specifies a CSS class to be applied to a column. */ cssClass?: string; + /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ + calculateDisplayValue?: any; /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ calculateGroupValue?: any; /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ @@ -2986,6 +3182,8 @@ declare module DevExpress.ui { dataType?: string; /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ editCellTemplate?: any; + /** Specifies configuration options for the editor widget of the current column. */ + editorOptions?: Object; /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ encodeHtml?: boolean; /** In a boolean column, replaces all false items with a specified text. */ @@ -3021,6 +3219,13 @@ declare module DevExpress.ui { /** Specifies the expression defining the data source field whose values must be replaced. */ valueExpr?: string; }; + /** Specifies column-level options for filtering using a column header filter. */ + headerFilter?: { + /** Specifies the data source to be used for header filter. */ + dataSource?: any; + /** Specifies how header filter values should be combined into groups. */ + groupInterval?: any; + }; /** Specifies a precision for formatted values displayed in a column. */ precision?: number; /** Specifies a filter operation applied to a column. */ @@ -3047,6 +3252,8 @@ declare module DevExpress.ui { showInColumnChooser?: boolean; /** Specifies the identifier of the column. */ name?: string; + /** The form item configuration object. Used only when the editing mode is "form". */ + formItem?: DevExpress.ui.dxFormItem; } export interface dxDataGridOptions extends WidgetOptions { /** Specifies whether the outer borders of the grid are visible or not. */ @@ -3057,40 +3264,30 @@ declare module DevExpress.ui { onRowValidating?: (e: Object) => void; /** A handler for the contextMenuPreparing event. */ onContextMenuPreparing?: (e: Object) => void; - initNewRow?: (e: { data: Object }) => void; /** A handler for the initNewRow event. */ onInitNewRow?: (e: { data: Object }) => void; - rowInserted?: (e: { data: Object; key: any }) => void; /** A handler for the rowInserted event. */ onRowInserted?: (e: { data: Object; key: any }) => void; - rowInserting?: (e: { data: Object; cancel: boolean }) => void; /** A handler for the rowInserting event. */ - onRowInserting?: (e: { data: Object; cancel: boolean }) => void; - rowRemoved?: (e: { data: Object; key: any }) => void; + onRowInserting?: (e: { data: Object; cancel: any }) => void; /** A handler for the rowRemoved event. */ onRowRemoved?: (e: { data: Object; key: any }) => void; - rowRemoving?: (e: { data: Object; key: any; cancel: boolean }) => void; /** A handler for the rowRemoving event. */ - onRowRemoving?: (e: { data: Object; key: any; cancel: boolean }) => void; - rowUpdated?: (e: { data: Object; key: any }) => void; + onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; /** A handler for the rowUpdated event. */ onRowUpdated?: (e: { data: Object; key: any }) => void; - rowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: boolean }) => void; /** A handler for the rowUpdating event. */ - onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: boolean }) => void; + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ cellHintEnabled?: boolean; /** Specifies whether or not grid columns can be reordered by a user. */ allowColumnReordering?: boolean; /** Specifies whether or not grid columns can be resized by a user. */ allowColumnResizing?: boolean; - cellClick?: any; /** A handler for the cellClick event. */ onCellClick?: any; - cellHoverChanged?: (e: Object) => void; /** A handler for the cellHoverChanged event. */ onCellHoverChanged?: (e: Object) => void; - cellPrepared?: (e: Object) => void; /** A handler for the cellPrepared event. */ onCellPrepared?: (e: Object) => void; /** Specifies whether or not the width of grid columns depends on column content. */ @@ -3145,18 +3342,12 @@ declare module DevExpress.ui { /** An array of grid columns. */ columns?: Array; onContentReady?: Function; - contentReadyAction?: Function; /** Specifies a function that customizes grid columns after they are created. */ customizeColumns?: (columns: Array) => void; - dataErrorOccurred?: (errorObject: Error) => void; /** Specifies a data source for the grid. */ dataSource?: any; - editingStart?: (e: { - data: Object; - key: any; - cancel: boolean; - column: dxDataGridColumn - }) => void; + /** Specifies whether or not to enable data caching. */ + cacheEnabled?: boolean; /** A handler for the editingStart event. */ onEditingStart?: (e: { data: Object; @@ -3164,27 +3355,31 @@ declare module DevExpress.ui { cancel: boolean; column: dxDataGridColumn }) => void; - editorPrepared?: (e: Object) => void; /** A handler for the editorPrepared event. */ onEditorPrepared?: (e: Object) => void; - editorPreparing?: (e: Object) => void; /** A handler for the editorPreparing event. */ onEditorPreparing?: (e: Object) => void; /** Contains options that specify how grid content can be changed. */ editing?: { - /** Specifies whether or not grid records can be edited at runtime. */ - editEnabled?: boolean; - /** Specifies how grid values can be edited manually. */ editMode?: string; - /** Specifies whether or not new records can be inserted into a grid. */ + editEnabled?: boolean; insertEnabled?: boolean; - /** Specifies whether or not records can be deleted from a grid. */ removeEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + mode?: string; + /** Specifies whether or not grid records can be edited at runtime. */ + allowUpdating?: boolean; + /** Specifies whether or not new grid records can be added at runtime. */ + allowAdding?: boolean; + /** Specifies whether or not grid records can be deleted at runtime. */ + allowDeleting?: boolean; + /** The form configuration object. Used only when the editing mode is "form". */ + form?: DevExpress.ui.dxFormOptions; /** Contains options that specify texts for editing-related grid controls. */ texts?: { /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the editMode option is set to batch. */ saveAllChanges?: string; - /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ cancelRowChanges?: string; /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the editMode option is set to batch. */ cancelAllChanges?: string; @@ -3192,15 +3387,17 @@ declare module DevExpress.ui { confirmDeleteMessage?: string; /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ confirmDeleteTitle?: string; - /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the removeEnabled option is set to true. */ + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the editMode option is set to cell and the validation capabilities are enabled. */ + validationCancelChanges?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ deleteRow?: string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the insertEnabled option is true. */ + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ addRow?: string; - /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ editRow?: string; - /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ saveRowChanges?: string; - /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the removeEnabled option is set to true. */ + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ undeleteRow?: string; }; }; @@ -3227,6 +3424,10 @@ declare module DevExpress.ui { resetOperationText?: string; /** Specifies text for the operation of clearing the applied filter when a select box is used. */ showAllText?: string; + /** Specifies text for the range start in the 'between' filter type. */ + betweenStartText?: string; + /** Specifies text for the range end in the 'between' filter type. */ + betweenEndText?: string; /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ showOperationChooser?: boolean; /** Specifies whether the filter row is visible or not. */ @@ -3297,10 +3498,8 @@ declare module DevExpress.ui { }; /** Specifies whether or not grid rows must be shaded in a different way. */ rowAlternationEnabled?: boolean; - rowClick?: any; /** A handler for the rowClick event. */ onRowClick?: any; - rowPrepared?: (e: Object) => void; /** A handler for the rowPrepared event. */ onRowPrepared?: (e: Object) => void; /** Specifies a custom template for grid rows. */ @@ -3311,6 +3510,14 @@ declare module DevExpress.ui { mode?: string; /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ preloadEnabled?: boolean; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + /** Specifies the scrollbar display policy. */ + showScrollbar?: string; + /** Specifies whether or not the scrolling by content is enabled. */ + scrollByContent?: boolean; + /** Specifies whether or not the scrollbar thumb scrolling enabled. */ + scrollByThumb?: boolean; }; /** Specifies options of the search panel. */ searchPanel?: { @@ -3375,17 +3582,13 @@ declare module DevExpress.ui { selectedRowKeys?: Array; /** Specifies options of runtime selection. */ selection?: { + /** Specifies the checkbox row display policy in the multiple mode. */ + showCheckBoxesMode?: string; /** Specifies whether the user can select all grid records at once. */ allowSelectAll?: boolean; /** Specifies the selection mode. */ mode?: string; }; - selectionChanged?: (e: { - currentSelectedRowKeys: Array; - currentDeselectedRowKeys: Array; - selectedRowKeys: Array; - selectedRowsData: Array; - }) => void; /** A handler for the dataErrorOccured event. */ onDataErrorOccurred?: (e: { error: Error }) => void; /** A handler for the selectionChanged event. */ @@ -3435,7 +3638,7 @@ declare module DevExpress.ui { /** Specifies a callback function that performs specific actions on state loading. */ customLoad?: () => JQueryPromise; /** Specifies a callback function that performs specific actions on state saving. */ - customSave?: (gridState: Object) => void; + customSave?: (state: Object) => void; /** Specifies whether or not a grid saves its state. */ enabled?: boolean; /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ @@ -3554,10 +3757,14 @@ declare module DevExpress.ui { getKeyByRowIndex(rowIndex: number): any; /** Adds a new column to a grid. */ addColumn(columnOptions: dxDataGridColumn): void; + /** Removes the column from the grid. */ + deleteColumn(id: any): void; /** Displays the load panel. */ beginCustomLoading(messageText: string): void; /** Discards changes made in a grid. */ cancelEditData(): void; + /** Checks whether or not the grid contains unsaved changes. */ + hasEditData(): boolean; /** Clears all the filters of a specific type applied to grid records. */ clearFilter(): void; /** Deselects all grid records. */ @@ -3577,9 +3784,19 @@ declare module DevExpress.ui { /** Sets several options of a column at once. */ columnOption(id: any, options: Object): void; /** Sets a specific cell into the editing state. */ - editCell(rowIndex: number, columnIndex: number): void; + editCell(rowIndex: number, visibleColumnIndex: number): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, dataField: string): void; /** Sets a specific row into the editing state. */ editRow(rowIndex: number): void; + /** Gets the cell value. */ + cellValue(rowIndex: number, dataField: string): any; + /** Gets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number): any; + /** Sets the cell value. */ + cellValue(rowIndex: number, dataField: string, value: any): void; + /** Sets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; /** Hides the load panel. */ endCustomLoading(): void; /** Expands groups or master rows in a grid. */ @@ -3603,6 +3820,11 @@ declare module DevExpress.ui { /** Hides the column chooser panel. */ hideColumnChooser(): void; /** Adds a new data row to a grid. */ + addRow(): void; + /** + * Adds a new data row to a grid. + * @deprecated Use the addRow() method instead. + */ insertRow(): void; /** Returns the key corresponding to the passed data object. */ keyOf(obj: Object): any; @@ -3617,6 +3839,11 @@ declare module DevExpress.ui { /** Refreshes grid data. */ refresh(): void; /** Removes a specific row from a grid. */ + deleteRow(rowIndex: number): void; + /** + * Removes a specific row from a grid. + * @deprecated Use the deleteRow() method instead. + */ removeRow(rowIndex: number): void; /** Saves changes made in a grid. */ saveEditData(): void; @@ -3656,8 +3883,14 @@ declare module DevExpress.ui { onContentReady?: Function; /** Specifies a data source for the pivot grid. */ dataSource?: any; - /** Specifies whether or not the widget uses native scrolling. */ useNativeScrolling?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + }; /** Allows an end-user to change sorting options. */ allowSorting?: boolean; /** Allows an end-user to sort columns by summary values. */ @@ -3674,6 +3907,12 @@ declare module DevExpress.ui { showColumnTotals?: boolean; /** Specifies whether to display the Grand Total column. */ showColumnGrandTotals?: boolean; + /** Specifies whether or not to hide rows and columns with no data. */ + hideEmptySummaryCells?: boolean; + /** Specifies where to show the total rows or columns. */ + showTotalsPrior?: string; + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; /** The Field Chooser configuration options. */ fieldChooser?: { /** Enables or disables the field chooser. */ @@ -3720,6 +3959,8 @@ declare module DevExpress.ui { sortRowBySummary?: string; /** The string to display as a Remove All Sorting context menu item. */ removeAllSorting?: string; + /** The string to display as an Export to Excel file context menu item. */ + exportToExcel?: string; }; /** The Load panel configuration options. */ loadPanel?: { @@ -3744,6 +3985,38 @@ declare module DevExpress.ui { onCellPrepared?: (e: any) => void; /** A handler for the contextMenuPreparing event. */ onContextMenuPreparing?: (e: Object) => void; + /** Specifies options for exporting pivot grid data. */ + export?: { + /** Indicates whether the export feature is enabled for the pivot grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + }; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + format: string; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A configuration object specifying options related to state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; } /** A data summarization widget for multi-dimensional data analysis and data mining. */ export class dxPivotGrid extends Widget { @@ -3751,8 +4024,12 @@ declare module DevExpress.ui { constructor(element: Element, options?: dxPivotGridOptions); /** Gets the PivotGridDataSource instance. */ getDataSource(): DevExpress.data.PivotGridDataSource; + /** Gets the dxPopup instance of the field chooser window. */ + getFieldChooserPopup(): DevExpress.ui.dxPopup; /** Updates the widget to the size of its content. */ updateDimensions(): void; + /** Exports pivot grid data to the Excel file. */ + exportToExcel(): void; } export interface dxPivotGridFieldChooserOptions extends WidgetOptions { /** Specifies the height of the widget. */ @@ -3847,7 +4124,6 @@ declare module DevExpress.framework { setView(key: string, viewInfo: Object): void; } export interface dxCommandOptions extends DOMComponentOptions { - action?: any; /** Specifies an action performed when the execute() method of the command is called. */ onExecute?: any; /** Indicates whether or not the widget that displays this command is disabled. */ @@ -3933,6 +4209,8 @@ declare module DevExpress.framework { viewCache?: Object; /** Specifies a limit for the views that can be cached. */ viewCacheSize?: number; + /** Specifies the current version of application templates. */ + templatesVersion?: string; /** Specifies options for the viewport meta tag of a mobile browser. */ viewPort?: JQuery; /** A custom router to be used in the application. */ @@ -3947,6 +4225,7 @@ declare module DevExpress.framework { navigating: JQueryCallback; navigatingBack: JQueryCallback; resolveLayoutController: JQueryCallback; + resolveViewCacheKey: JQueryCallback; viewDisposed: JQueryCallback; viewDisposing: JQueryCallback; viewHidden: JQueryCallback; @@ -4013,6 +4292,11 @@ declare module DevExpress.framework { layoutController: Object; availableLayoutControllers: Array; }) => void): HtmlApplication; + on(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; on(eventName: "viewDisposed", eventHandler: (e: { viewInfo: Object; }) => void): HtmlApplication; @@ -4041,6 +4325,7 @@ declare module DevExpress.framework { off(eventName: "navigating"): HtmlApplication; off(eventName: "navigatingBack"): HtmlApplication; off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "resolveViewCacheKey"): HtmlApplication; off(eventName: "viewDisposed"): HtmlApplication; off(eventName: "viewDisposing"): HtmlApplication; off(eventName: "viewHidden"): HtmlApplication; @@ -4076,6 +4361,11 @@ declare module DevExpress.framework { layoutController: Object; availableLayoutControllers: Array; }) => void): HtmlApplication; + off(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; off(eventName: "viewDisposed", eventHandler: (e: { viewInfo: Object; }) => void): HtmlApplication; @@ -4169,13 +4459,13 @@ declare module DevExpress.viz.core { width?: number; } export interface Margins { - /** Specifies the legend's bottom margin in pixels. */ + /** Specifies the distance in pixels between the bottom side of the title and the surrounding widget elements. */ bottom?: number; - /** Specifies the legend's left margin in pixels. */ + /** Specifies the distance in pixels between the left side of the title and the surrounding widget elements. */ left?: number; - /** Specifies the legend's right margin in pixels. */ + /** Specifies the distance between the right side of the title and surrounding widget elements in pixels. */ right?: number; - /** Specifies the legend's bottom margin in pixels. */ + /** Specifies the distance between the top side of the title and surrounding widget elements in pixels. */ top?: number; } export interface Size { @@ -4184,6 +4474,27 @@ declare module DevExpress.viz.core { /** Specifies the height of the widget. */ height?: number; } + export interface Title { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the widget title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies the widget title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the distance between the title and surrounding widget elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + } export interface Tooltip { /** Specifies the length of the tooltip's arrow in pixels. */ arrowLength?: number; @@ -4193,6 +4504,7 @@ declare module DevExpress.viz.core { color?: string; /** Specifies the z-index for tooltips. */ zIndex?: number; + /** Specifies the container to draw tooltips inside of it. */ container?: any; /** Specifies text and appearance of a set of tooltips. */ customizeTooltip?: (arg: Object) => { color?: string; text?: string }; @@ -4283,32 +4595,23 @@ declare module DevExpress.viz.core { visible?: boolean; } export interface BaseWidgetOptions { - drawn?: (widget: Object) => void; /** A handler for the drawn event. */ onDrawn?: (e: { component: BaseWidget; element: Element; }) => void; - incidentOccured?: (incidentInfo: { + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { id: string; type: string; args: any; text: string; widget: string; version: string; - }) => void; - /** A handler for the incidentOccurred event. */ - onIncidentOccurred?: ( - component: BaseWidget, - element: Element, - target: { - id: string; - type: string; - args: any; - text: string; - widget: string; - version: string; - } + } ) => void; /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ pathModified?: boolean; @@ -4334,11 +4637,6 @@ declare module DevExpress.viz.charts { clearSelection(): void; /** Gets the color of a particular series. */ getColor(): string; - /** - * Gets a point from the series point collection based on the specified argument. - * @deprecated getPointsByArg(pointArg).md - */ - getPointByArg(pointArg: any): Object; /** Gets points from the series point collection based on the specified argument. */ getPointsByArg(pointArg: any): Array; /** Gets a point from the series point collection based on the specified point position. */ @@ -4353,6 +4651,20 @@ declare module DevExpress.viz.charts { getAllPoints(): Array; /** Returns visible series points. */ getVisiblePoints(): Array; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): boolean; + /** Provides information about the selection state of a series. */ + isSelected(): boolean; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; } /** This section describes the methods that can be used in code to manipulate the Point object. */ export interface BasePoint { @@ -4371,9 +4683,9 @@ declare module DevExpress.viz.charts { /** Hides the tooltip of the point. */ hideTooltip(): void; /** Provides information about the hover state of a point. */ - isHovered(): any; + isHovered(): boolean; /** Provides information about the selection state of a point. */ - isSelected(): any; + isSelected(): boolean; /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ select(): void; /** Shows the tooltip of the point. */ @@ -4389,20 +4701,6 @@ declare module DevExpress.viz.charts { pane: string; /** Returns the name of the value axis of the series. */ axis: string; - /** Returns the name of the series. */ - name: string; - /** Returns the tag of the series. */ - tag: string; - /** Hides a series. */ - hide(): void; - /** Provides information about the hover state of a series. */ - isHovered(): any; - /** Provides information about the selection state of a series. */ - isSelected(): any; - /** Provides information about the visibility state of a series. */ - isVisible(): boolean; - /** Makes a particular series visible. */ - show(): void; selectPoint(point: ChartPoint): void; deselectPoint(point: ChartPoint): void; getAllPoints(): Array; @@ -4457,20 +4755,6 @@ declare module DevExpress.viz.charts { export interface PolarSeries extends BaseSeries { /** Returns the name of the value axis of the series. */ axis: string; - /** Returns the name of the series. */ - name: string; - /** Returns the tag of the series. */ - tag: string; - /** Hides a series. */ - hide(): void; - /** Provides information about the hover state of a series. */ - isHovered(): any; - /** Provides information about the selection state of a series. */ - isSelected(): any; - /** Provides information about the visibility state of a series. */ - isVisible(): boolean; - /** Makes a particular series visible. */ - show(): void; selectPoint(point: PolarPoint): void; deselectPoint(point: PolarPoint): void; getAllPoints(): Array; @@ -4819,7 +5103,10 @@ declare module DevExpress.viz.charts { /** Specifies the hatching options to be applied when a point is hovered over. */ hatching?: viz.core.Hatching; }; - /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. */ + /** + * Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. + * @deprecated use the 'innerRadius' option instead + */ innerRadius?: number; /** An object defining the label configuration options. */ label?: PieSeriesConfigLabel; @@ -4827,7 +5114,10 @@ declare module DevExpress.viz.charts { maxLabelCount?: number; /** Specifies a minimal size of a displayed pie segment. */ minSegmentSize?: number; - /** Specifies the direction in which the dxPieChart's series points are located. */ + /** + * Specifies the direction in which the dxPieChart series points are located. + * @deprecated use the 'segmentsDirection' option instead + */ segmentsDirection?: string; /**

Specifies the chart elements to highlight when the series is selected.

*/ selectionMode?: string; @@ -4851,17 +5141,34 @@ declare module DevExpress.viz.charts { /** Specifies how many segments must not be grouped. */ topCount?: number; }; - /** Specifies a start angle for a pie chart in arc degrees. */ + /** + * Specifies a start angle for a pie chart in arc degrees. + * @deprecated use the 'startAngle' option instead + */ startAngle?: number; /**

Specifies the name of the data source field that provides data about a point.

*/ tagField?: string; /** Specifies the data source field that provides values for series points. */ valueField?: string; } - export interface PieSeriesConfig extends CommonPieSeriesConfig { - /** Sets the series type. */ + export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { + /** + * Sets a series type for all series. + * @deprecated use the 'type' option instead + */ type?: string; } + export interface PieSeriesConfig extends CommonPieSeriesConfig { + /** + * Sets the series type. + * @deprecated use the 'type' option instead + */ + type?: string; + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + } export interface SeriesTemplate { /** Specifies a callback function that returns a series object with individual series settings. */ customizeSeries?: (seriesName: string) => SeriesConfig; @@ -4980,6 +5287,10 @@ declare module DevExpress.viz.charts { opacity?: number; /** Indicates whether or not ticks are visible on an axis. */ visible?: boolean; + /** Specifies tick width. */ + width?: number; + /** Specifies tick length. */ + length?: number; }; /** Specifies the options of the minor ticks. */ minorTick?: { @@ -4989,6 +5300,10 @@ declare module DevExpress.viz.charts { opacity?: number; /** Indicates whether or not the minor ticks are displayed on an axis. */ visible?: boolean; + /** Specifies minor tick width. */ + width?: number; + /** Specifies minor tick length. */ + length?: number; }; /** Indicates whether or not the line that represents an axis in a chart is visible. */ visible?: boolean; @@ -5217,7 +5532,6 @@ declare module DevExpress.viz.charts { customizePoint?: (pointInfo: Object) => Object; /** Specifies a data source for the chart. */ dataSource?: any; - done?: Function; /** Specifies the appearance of the loading indicator. */ loadingIndicator?: viz.core.LoadingIndicator; /** Specifies options of a dxChart's (dxPieChart's) legend. */ @@ -5233,21 +5547,18 @@ declare module DevExpress.viz.charts { }) => void; /** A handler for the pointClick event. */ onPointClick?: any; - pointClick?: any; /** A handler for the pointHoverChanged event. */ onPointHoverChanged?: (e: { component: BaseChart; element: Element; target: TPoint; }) => void; - pointHoverChanged?: (point: TPoint) => void; /** A handler for the pointSelectionChanged event. */ onPointSelectionChanged?: (e: { component: BaseChart; element: Element; target: TPoint; }) => void; - pointSelectionChanged?: (point: TPoint) => void; /** Specifies whether a single point or multiple points can be selected in the chart. */ pointSelectionMode?: string; /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ @@ -5257,20 +5568,7 @@ declare module DevExpress.viz.charts { /** Specifies the size of the widget in pixels. */ size?: viz.core.Size; /** Specifies a title for the chart. */ - title?: { - /** Specifies font options for the title. */ - font?: viz.core.Font; - /** Specifies the title's horizontal position in the chart. */ - horizontalAlignment?: string; - /** Specifies a title's position on the chart in the vertical direction. */ - verticalAlignment?: string; - /** Specifies the distance between the title and surrounding chart elements in pixels. */ - margin?: viz.core.Margins; - /** Specifies the height of the space reserved for the title. */ - placeholderSize?: number; - /** Specifies a text for the chart's title. */ - text?: string; - }; + title?: viz.core.Title; /** Specifies tooltip options. */ tooltip?: BaseChartTooltip; /** A handler for the tooltipShown event. */ @@ -5285,8 +5583,6 @@ declare module DevExpress.viz.charts { element: Element; target: BasePoint; }) => void; - tooltipHidden?: (point: TPoint) => void; - tooltipShown?: (point: TPoint) => void; } /** A base class for all chart widgets included in the ChartJS library. */ export class BaseChart extends viz.core.BaseWidget { @@ -5294,6 +5590,12 @@ declare module DevExpress.viz.charts { clearSelection(): void; /** Gets the current size of the widget. */ getSize(): { width: number; height: number }; + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): BaseSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): BaseSeries; /** Displays the loading indicator. */ showLoadingIndicator(): void; /** Conceals the loading indicator. */ @@ -5349,6 +5651,10 @@ declare module DevExpress.viz.charts { seriesSelectionMode?: string; /** Specifies how the chart must behave when series point labels overlap. */ resolveLabelOverlapping?: string; + /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; } export interface Legend extends AdvancedLegend { /** Specifies whether the legend is located outside or inside the chart's plot. */ @@ -5361,8 +5667,6 @@ declare module DevExpress.viz.charts { shared?: boolean; } export interface dxChartOptions extends AdvancedOptions { - /** Specifies a value indicating whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ - equalBarWidth?: any; adaptiveLayout?: { keepLabels?: boolean; }; @@ -5374,7 +5678,6 @@ declare module DevExpress.viz.charts { adjustOnZoom?: boolean; /** Specifies argument axis options for the dxChart widget. */ argumentAxis?: ChartArgumentAxis; - argumentAxisClick?: any; /** An object defining the configuration options that are common for all axes of the dxChart widget. */ commonAxisSettings?: ChartCommonAxisSettings; /** An object defining the configuration options that are common for all panes in the dxChart widget. */ @@ -5413,7 +5716,7 @@ declare module DevExpress.viz.charts { maxBubbleSize?: number; /** Specifies the diameter of the smallest bubble measured in pixels. */ minBubbleSize?: number; - /** Defines the dxChart widget's pane(s). */ + /** Defines the dxChart widget's pane(s). */ panes?: Array; /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ rotated?: boolean; @@ -5421,10 +5724,6 @@ declare module DevExpress.viz.charts { legend?: Legend; /** Specifies options for dxChart widget series. */ series?: Array; - legendClick?: any; - seriesClick?: any; - seriesHoverChanged?: (series: ChartSeries) => void; - seriesSelectionChanged?: (series: ChartSeries) => void; /** Defines options for the series template. */ seriesTemplate?: SeriesTemplate; /** Specifies tooltip options. */ @@ -5455,12 +5754,6 @@ declare module DevExpress.viz.charts { export class dxChart extends BaseChart { constructor(element: JQuery, options?: dxChartOptions); constructor(element: Element, options?: dxChartOptions); - /** Returns an array of all series in the chart. */ - getAllSeries(): Array; - /** Gets a series within the chart's series collection by the specified name (see the name option). */ - getSeriesByName(seriesName: string): ChartSeries; - /** Gets a series within the chart's series collection by its position number. */ - getSeriesByPos(seriesIndex: number): ChartSeries; /** Sets the specified start and end values for the chart's argument axis. */ zoomArgument(startValue: any, endValue: any): void; } @@ -5480,8 +5773,6 @@ declare module DevExpress.viz.charts { shared?: boolean; } export interface dxPolarChartOptions extends AdvancedOptions { - /** Specifies a value indicating whether all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ - equalBarWidth?: boolean; /** Specifies adaptive layout options. */ adaptiveLayout?: { width?: number; @@ -5512,12 +5803,6 @@ declare module DevExpress.viz.charts { export class dxPolarChart extends BaseChart { constructor(element: JQuery, options?: dxPolarChartOptions); constructor(element: Element, options?: dxPolarChartOptions); - /** Returns an array of all series in the chart. */ - getAllSeries(): Array; - /** Gets a series within the chart's series collection by the specified name (see the name option). */ - getSeriesByName(seriesName: string): PolarSeries; - /** Gets a series within the chart's series collection by its position number. */ - getSeriesByPos(seriesIndex: number): PolarSeries; } export interface PieLegend extends core.BaseLegend { /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ @@ -5539,17 +5824,29 @@ declare module DevExpress.viz.charts { series?: Array; /** Specifies the diameter of the pie. */ diameter?: number; + /** Specifies the direction that the pie chart segments will occupy. */ + segmentsDirection?: string; + /** Specifies the starting angle in arc degrees for the first segment in a pie chart. */ + startAngle?: number; + /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ + innerRadius?: number; /** A handler for the legendClick event. */ onLegendClick?: any; - legendClick?: any; /** Specifies how a chart must behave when series point labels overlap. */ resolveLabelOverlapping?: string; + /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ + commonSeriesSettings?: CommonPieSeriesSettings; + /** Specifies the type of the pie chart series. */ + type?: string; } /** A circular chart widget for HTML JS applications. */ export class dxPieChart extends BaseChart { constructor(element: JQuery, options?: dxPieChartOptions); constructor(element: Element, options?: dxPieChartOptions); - /** Provides access to the dxPieChart series. */ + /** + * Provides access to the dxPieChart series. + * @deprecated ..\..\BaseChart\3 Methods\getAllSeries().md + */ getSeries(): PieSeries; } } @@ -5584,13 +5881,22 @@ declare module DevExpress.viz.gauges { export interface ScaleTick { /** Specifies the color of the scale's minor ticks. */ color?: string; - /** Specifies an array of custom minor ticks. */ + /** + * Specifies an array of custom minor ticks. + * @deprecated ..\customMinorTicks.md + */ customTickValues?: Array; /** Specifies the length of the scale's minor ticks. */ length?: number; - /** Indicates whether automatically calculated minor ticks are visible or not. */ + /** + * Indicates whether automatically calculated minor ticks are visible or not. + * @deprecated This functionality in not more available + */ showCalculatedTicks?: boolean; - /** Specifies an interval between minor ticks. */ + /** + * Specifies an interval between minor ticks. + * @deprecated ..\minorTickInterval.md + */ tickInterval?: number; /** Indicates whether scale minor ticks are visible or not. */ visible?: boolean; @@ -5598,14 +5904,28 @@ declare module DevExpress.viz.gauges { width?: number; } export interface ScaleMajorTick extends ScaleTick { - /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + /** + * Specifies whether or not to expand the current major tick interval if labels overlap each other. + * @deprecated ..\label\overlappingBehavior\useAutoArrangement.md + */ useTicksAutoArrangement?: boolean; } + export interface ScaleMinorTick extends ScaleTick { + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + } export interface BaseScaleLabel { /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ useRangeColors?: boolean; /** Specifies a callback function that returns the text to be displayed in scale labels. */ customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies the overlap resolving options to be applied to scale labels. */ + overlappingBehavior?: { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useAutoArrangement?: boolean; + /** Specifies what label to hide in case of overlapping. */ + hideFirstOrLast?: string; + }; /** Specifies font options for the text displayed in the scale labels of the gauge. */ font?: viz.core.Font; /** Specifies a format for the text displayed in scale labels. */ @@ -5618,20 +5938,56 @@ declare module DevExpress.viz.gauges { export interface BaseScale { /** Specifies the end value for the scale of the gauge. */ endValue?: number; - /** Specifies whether or not to hide the first scale label. */ + /** + * Specifies whether or not to hide the first scale label. + * @deprecated This functionality in not more available + */ hideFirstLabel?: boolean; - /** Specifies whether or not to hide the first major tick on the scale. */ + /** + * Specifies whether or not to hide the first major tick on the scale. + * @deprecated This functionality in not more available + */ hideFirstTick?: boolean; - /** Specifies whether or not to hide the last scale label. */ + /** + * Specifies whether or not to hide the last scale label. + * @deprecated This functionality in not more available + */ hideLastLabel?: boolean; - /** Specifies whether or not to hide the last major tick on the scale. */ + /** + * Specifies whether or not to hide the last major tick on the scale. + * @deprecated This functionality in not more available + */ hideLastTick?: boolean; + /** Specifies an interval between major ticks. */ + tickInterval?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: number; + /** Specifies an array of custom major ticks. */ + customTicks?: Array; + /** Specifies an array of custom minor ticks. */ + customMinorTicks?: Array; /** Specifies common options for scale labels. */ label?: BaseScaleLabel; - /** Specifies options of the gauge's major ticks. */ + /** + * Specifies options of the gauge's major ticks. + * @deprecated ..\tick\tick.md + */ majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's major ticks. */ + tick?: { + /** Specifies the color of the scale's major ticks. */ + color?: string; + /** Specifies the length of the scale's major ticks. */ + length?: number; + /** Indicates whether scale major ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's major ticks. */ + width?: number; + /** Specifies the opacity of the scale's major ticks. */ + opacity?: number; + }; /** Specifies options of the gauge's minor ticks. */ - minorTick?: ScaleTick; + minorTick?: ScaleMinorTick; /** Specifies the start value for the scale of the gauge. */ startValue?: number; } @@ -5688,21 +6044,48 @@ declare module DevExpress.viz.gauges { redrawOnResize?: boolean; /** Specifies the size of the widget in pixels. */ size?: viz.core.Size; - /** Specifies a subtitle for a gauge. */ + /** + * Specifies a subtitle for the widget. + * @deprecated ..\..\..\BaseGauge\1 Configuration\title\subtitle\subtitle.md + */ subtitle?: { - /** Specifies font options for the subtitle. */ + /** + * Specifies font options for the subtitle. + * @deprecated ..\..\title\subtitle\font\font.md + */ font?: viz.core.Font; - /** Specifies a text for the subtitle. */ + /** + * Specifies a text for the subtitle. + * @deprecated ..\title\subtitle\text.md + */ text?: string; }; /** Specifies a title for a gauge. */ title?: { /** Specifies font options for the title. */ font?: viz.core.Font; - /** Specifies a title's position on the gauge. */ + /** + * Specifies a title's position on the gauge. + * @deprecated basegaugeoptions_title_verticalAlignment and basegaugeoptions_title_horizontalAlignment + */ position?: string; - /** Specifies a text for the title. */ + /** Specifies the distance between the title and surrounding gauge elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies the gauge title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the gauge title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies text for the title. */ text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } }; /** Specifies options for gauge tooltips. */ tooltip?: viz.core.Tooltip; @@ -5911,6 +6294,8 @@ declare module DevExpress.viz.rangeSelector { /** Indicates whether or not the background (background color and/or image) is visible. */ visible?: boolean; }; + /** Specifies a title for the range selector. */ + title?: viz.core.Title; /** Specifies the dxRangeSelector's behavior options. */ behavior?: { /** Indicates whether or not you can swap sliders. */ @@ -5941,8 +6326,10 @@ declare module DevExpress.viz.rangeSelector { /** Specifies how to sort series points. */ sortingMethod?: any; }; - /** Specifies a value indicating whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ - equalBarWidth?: any; + /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ palette?: any; /** An object defining the chart’s series. */ @@ -6076,7 +6463,6 @@ declare module DevExpress.viz.rangeSelector { /** Specifies range selector's right indent. */ right?: number; }; - selectedRangeChanged?: (selectedRange: { startValue: any; endValue: any; }) => void; /** A handler for the selectedRangeChanged event. */ onSelectedRangeChanged?: (e: { startValue: any; @@ -6168,145 +6554,426 @@ interface JQuery { dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; } declare module DevExpress.viz.map { - /** This section describes the fields and methods that can be used in code to manipulate the Area object. */ + /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ + export interface MapLayer { + /** The name of the layer. */ + name: string; + /** The layer index in the layers array. */ + index: number; + /** The layer type. Can be "area", "line" or "marker". */ + type: string; + /** The type of the layer elements. */ + elementType: string; + /** Gets all layer elements. */ + getElements(): Array; + /** Deselects all layer elements. */ + clearSelection(): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ + export interface MapLayerElement { + /** The parent layer of the layer element. */ + layer: MapLayer; + /** Gets the layer element coordinates. */ + coordinates(): Object; + /** Sets the value of an attribute. */ + attribute(name: string, value: any): void; + /** Gets the value of an attribute. */ + attribute(name: string): any; + /** Gets the selection state of the layer element. */ + selected(): boolean; + /** Sets the selection state of the layer element. */ + selected(state: boolean): void; + /** Applies the layer element settings and updates the element appearance. */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Area object. + * @deprecated Use the "Layer Element" instead + */ export interface Area { - /** Contains the element type. */ + /** + * Contains the element type. + * @deprecated ..\..\Layer\2 Fields\type.md + */ type: string; - /** Return the value of an attribute. */ + /** + * Return the value of an attribute. + * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + */ attribute(name: string): any; - /** Provides information about the selection state of an area. */ + /** + * Provides information about the selection state of an area. + * @deprecated Use the "selected()" method of the Layer Element + */ selected(): boolean; - /** Sets a new selection state for an area. */ + /** + * Sets a new selection state for an area. + * @deprecated Use the "selected(state)" method of the Layer Element + */ selected(state: boolean): void; - /** Applies the area settings specified as a parameter and updates the area appearance. */ + /** + * Applies the area settings specified as a parameter and updates the area appearance. + * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + */ applySettings(settings: any): void; } - /** This section describes the fields and methods that can be used in code to manipulate the Markers object. */ + /** + * This section describes the fields and methods that can be used in code to manipulate the Markers object. + * @deprecated Use the "Layer Element" instead + */ export interface Marker { - /** Contains the descriptive text accompanying the map marker. */ + /** + * Contains the descriptive text accompanying the map marker. + * @deprecated Get the text with the "attribute" method (using the "layers.label.dataField" value) + */ text: string; - /** Contains the type of the element. */ + /** + * Contains the type of the element. + * @deprecated ..\..\Layer\2 Fields\type.md + */ type: string; - /** Contains the URL of an image map marker. */ + /** + * Contains the URL of an image map marker. + * @deprecated Get the url with the "attribute" method (using the "layers.dataField" value) + */ url: string; - /** Contains the value of a bubble map marker. */ + /** + * Contains the value of a bubble map marker. + * @deprecated Get the value with the "attribute" method (using the "layers.dataField" value) + */ value: number; - /** Contains the values of a pie map marker. */ + /** + * Contains the values of a pie map marker. + * @deprecated Get the values with the "attribute" method (using the "layers.dataField" value) + */ values: Array; - /** Returns the value of an attribute. */ + /** + * Returns the value of an attribute. + * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + */ attribute(name: string): any; - /** Returns the coordinates of a specific marker. */ + /** + * Returns the coordinates of a specific marker. + * @deprecated ..\..\Layer Element\3 Methods\coordinates().md + */ coordinates(): Array; - /** Provides information about the selection state of a marker. */ + /** + * Provides information about the selection state of a marker. + * @deprecated Use the "selected()" method of the Layer Element + */ selected(): boolean; - /** Sets a new selection state for a marker. */ + /** + * Sets a new selection state for a marker. + * @deprecated Use the "selected(state)" method of the Layer Element + */ selected(state: boolean): void; - /** Applies the marker settings specified as a parameter and updates the marker appearance. */ + /** + * Applies the marker settings specified as a parameter and updates marker appearance. + * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + */ applySettings(settings: any): void; } - export interface AreaSettings { - /** Specifies the width of the area border in pixels. */ + export interface MapLayerSettings { + /** Specifies the layer name. */ + name?: string; + /** Specifies layer type. */ + type?: string; + /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ + elementType?: string; + /** Specifies a data source for the layer element. */ + data?: any; + /** Specifies the width of the layer elements border in pixels. */ borderWidth?: number; - /** Specifies a color for the area border. */ + /** Specifies a color for the border of the layer elements. */ borderColor?: string; - click?: any; - /** Specifies a color for an area. */ + /** Specifies a color for layer elements. */ color?: string; - /** Specifies the function that customizes each area individually. */ - customize?: (areaInfo: Area) => AreaSettings; - /** Specifies a color for the area border when the area is hovered over. */ + /** Specifies a color for the border of the layer element when it is hovered over. */ hoveredBorderColor?: string; - /** Specifies the pixel-measured width of the area border when the area is hovered over. */ + /** Specifies the pixel-measured width for the border of the layer element when it is hovered over. */ hoveredBorderWidth?: number; - /** Specifies a color for an area when this area is hovered over. */ + /** Specifies a color for a layer element when it is hovered over. */ hoveredColor?: string; - /** Specifies whether or not to change the appearance of an area when it is hovered over. */ + /** Specifies a pixel-measured width for the border of the layer element when it is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the border of the layer element when it is selected. */ + selectedBorderColor?: string; + /** Specifies a color for the layer element when it is selected. */ + selectedColor?: string; + /** Specifies the layer opacity (from 0 to 1). */ + opacity?: number; + /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ + size?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ + minSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ + maxSize?: number; + /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ hoverEnabled?: boolean; - /** Configures area labels. */ - label?: { - /** Specifies the data field that provides data for area labels. */ - dataField?: string; - /** Enables area labels. */ - enabled?: boolean; - /** Specifies font options for area labels. */ - font?: viz.core.Font; - }; - /** Specifies the name of the palette or a custom range of colors to be used for coloring a map. */ + /** Specifies whether single or multiple map elements can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ palette?: any; /** Specifies the number of colors in a palette. */ paletteSize?: number; - /** Allows you to paint areas with similar attributes in the same color. */ + /** Allows you to paint layer elements with similar attributes in the same color. */ colorGroups?: Array; - /** Specifies the field that provides data to be used for coloring areas. */ + /** Specifies the field that provides data to be used for coloring of layer elements. */ colorGroupingField?: string; - /** Specifies a color for the area border when the area is selected. */ - selectedBorderColor?: string; - /** Specifies a color for an area when this area is selected. */ - selectedColor?: string; - /** Specifies the pixel-measured width of the area border when the area is selected. */ - selectedBorderWidth?: number; - selectionChanged?: (area: Area) => void; - /** Specifies whether single or multiple areas can be selected on a vector map. */ - selectionMode?: string; - } - export interface MarkerSettings { - /** Specifies a color for the marker border. */ - borderColor?: string; - /** Specifies the width of the marker border in pixels. */ - borderWidth?: number; - click?: any; - /** Specifies a color for a marker of the dot or bubble type. */ - color?: string; - /** Specifies the function that customizes each marker individually. */ - customize?: (markerInfo: Marker) => MarkerSettings; - font?: Object; - /** Specifies the pixel-measured width of the marker border when the marker is hovered over. */ - hoveredBorderWidth?: number; - /** Specifies a color for the marker border when the marker is hovered over. */ - hoveredBorderColor?: string; - /** Specifies a color for a marker of the dot or bubble type when this marker is hovered over. */ - hoveredColor?: string; - /** Specifies whether or not to change the appearance of a marker when it is hovered over. */ - hoverEnabled?: boolean; + /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroupingField?: string; + /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ + dataField?: string; + /** Specifies the function that customizes each layer element individually. */ + customize?: (eleemnts: Array) => void; /** Specifies marker label options. */ label?: { + /** The name of the data attribute containing marker texts. */ + dataField?: string; /** Enables marker labels. */ enabled?: boolean; /** Specifies font options for marker labels. */ font?: viz.core.Font; }; - /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. */ - maxSize?: number; - /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. */ - minSize?: number; - /** Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. */ - opacity?: number; - /** Specifies the pixel-measured width of the marker border when the marker is selected. */ - selectedBorderWidth?: number; - /** Specifies a color for the marker border when the marker is selected. */ - selectedBorderColor?: string; - /** Specifies a color for a marker of the dot or bubble type when this marker is selected. */ - selectedColor?: string; - selectionChanged?: (marker: Marker) => void; - /** Specifies whether a single or multiple markers can be selected on a vector map. */ - selectionMode?: string; - /** Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. */ - size?: number; - /** Specifies the type of markers to be used on the map. */ - type?: string; - /** Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. */ + } + export interface AreaSettings { + /** + * Specifies the width of the area border in pixels. + * @deprecated ..\layers\borderWidth.md + */ + borderWidth?: number; + /** + * Specifies a color for the area border. + * @deprecated ..\layers\borderColor.md + */ + borderColor?: string; + /** + * Specifies a color for an area. + * @deprecated ..\layers\color.md + */ + color?: string; + /** + * Specifies the function that customizes each area individually. + * @deprecated ..\layers\customize.md + */ + customize?: (areaInfo: Area) => AreaSettings; + /** + * Specifies a color for the area border when the area is hovered over. + * @deprecated ..\layers\hoveredBorderColor.md + */ + hoveredBorderColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is hovered over. + * @deprecated ..\layers\hoveredBorderWidth.md + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for an area when this area is hovered over. + * @deprecated ..\layers\hoveredColor.md + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of an area when it is hovered over. + * @deprecated ..\layers\hoverEnabled.md + */ + hoverEnabled?: boolean; + /** + * Configures area labels. + * @deprecated ..\..\layers\label\label.md + */ + label?: { + /** + * Specifies the data field that provides data for area labels. + * @deprecated ..\..\layers\label\dataField.md + */ + dataField?: string; + /** + * Enables area labels. + * @deprecated ..\..\layers\label\enabled.md + */ + enabled?: boolean; + /** + * Specifies font options for area labels. + * @deprecated ..\..\..\layers\label\font\font.md + */ + font?: viz.core.Font; + }; + /** + * Specifies the name of the palette or a custom range of colors to be used for coloring a map. + * @deprecated ..\layers\palette.md + */ palette?: any; - /** Allows you to paint markers with similar attributes in the same color. */ + /** + * Specifies the number of colors in a palette. + * @deprecated ..\layers\paletteSize.md + */ + paletteSize?: number; + /** + * Allows you to paint areas with similar attributes in the same color. + * @deprecated ..\layers\colorGroups.md + */ colorGroups?: Array; - /** Specifies the field that provides data to be used for coloring markers. */ + /** + * Specifies the field that provides data to be used for coloring areas. + * @deprecated ..\layers\colorGroupingField.md + */ colorGroupingField?: string; - /** Allows you to display bubbles with similar attributes in the same size. */ + /** + * Specifies a color for the area border when the area is selected. + * @deprecated ..\layers\selectedBorderColor.md + */ + selectedBorderColor?: string; + /** + * Specifies a color for an area when this area is selected. + * @deprecated ..\layers\selectedColor.md + */ + selectedColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is selected. + * @deprecated ..\layers\selectedBorderWidth.md + */ + selectedBorderWidth?: number; + /** + * Specifies whether single or multiple areas can be selected on a vector map. + * @deprecated ..\layers\selectionMode.md + */ + selectionMode?: string; + } + export interface MarkerSettings { + /** + * Specifies a color for the marker border. + * @deprecated ..\layers\borderColor.md + */ + borderColor?: string; + /** + * Specifies the width of the marker border in pixels. + * @deprecated ..\layers\borderWidth.md + */ + borderWidth?: number; + /** + * Specifies a color for a marker of the dot or bubble type. + * @deprecated ..\layers\color.md + */ + color?: string; + /** + * Specifies the function that customizes each marker individually. + * @deprecated ..\layers\customize.md + */ + customize?: (markerInfo: Marker) => MarkerSettings; + /** + * Specifies the pixel-measured width of the marker border when the marker is hovered over. + * @deprecated ..\layers\hoveredBorderWidth.md + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is hovered over. + * @deprecated ..\layers\hoveredBorderColor.md + */ + hoveredBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. + * @deprecated ..\layers\hoveredColor.md + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of a marker when it is hovered over. + * @deprecated ..\layers\hoverEnabled.md + */ + hoverEnabled?: boolean; + /** + * Specifies marker label options. + * @deprecated ..\..\layers\label\label.md + */ + label?: { + /** + * Enables marker labels. + * @deprecated ..\..\layers\label\enabled.md + */ + enabled?: boolean; + /** + * Specifies font options for marker labels. + * @deprecated ..\..\..\layers\label\font\font.md + */ + font?: viz.core.Font; + }; + /** + * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\maxSize.md + */ + maxSize?: number; + /** + * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\minSize.md + */ + minSize?: number; + /** + * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\opacity.md + */ + opacity?: number; + /** + * Specifies the pixel-measured width of the marker border when the marker is selected. + * @deprecated ..\layers\selectedBorderWidth.md + */ + selectedBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is selected. + * @deprecated ..\layers\selectedBorderColor.md + */ + selectedBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is selected. + * @deprecated ..\layers\selectedColor.md + */ + selectedColor?: string; + /** + * Specifies whether a single or multiple markers can be selected on a vector map. + * @deprecated ..\layers\selectionMode.md + */ + selectionMode?: string; + /** + * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. + * @deprecated ..\layers\size.md + */ + size?: number; + /** + * Specifies the type of markers to be used on the map. + * @deprecated ..\layers\elementType.md + */ + type?: string; + /** + * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. + * @deprecated ..\layers\palette.md + */ + palette?: any; + /** + * Allows you to paint markers with similar attributes in the same color. + * @deprecated ..\layers\colorGroups.md + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring markers. + * @deprecated ..\layers\colorGroupingField.md + */ + colorGroupingField?: string; + /** + * Allows you to display bubbles with similar attributes in the same size. + * @deprecated ..\layers\sizeGroups.md + */ sizeGroups?: Array; - /** Specifies the field that provides data to be used for sizing bubble markers. */ + /** + * Specifies the field that provides data to be used for sizing bubble markers. + * @deprecated ..\layers\sizeGroupingField.md + */ sizeGroupingField?: string; } export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { - /** An object specifying options for the map areas. */ + /** + * An object specifying options for the map areas. + * @deprecated Use the 'layers' option instead + */ areaSettings?: AreaSettings; /** Specifies the options for the map background. */ background?: { @@ -6315,6 +6982,10 @@ declare module DevExpress.viz.map { /** Specifies a color for the background. */ color?: string; }; + /** Specifies options for dxVectorMap widget layers. */ + layers?: Array; + /** Specifies the map projection. */ + projection?: Object; /** Specifies the positioning of a map in geographical coordinates. */ bounds?: Array; /** Specifies the options of the control bar. */ @@ -6336,14 +7007,25 @@ declare module DevExpress.viz.map { }; /** Specifies the appearance of the loading indicator. */ loadingIndicator?: viz.core.LoadingIndicator; - /** Specifies a data source for the map area. */ + /** + * Specifies a data source for the map area. + * @deprecated Use the 'layers.data' option instead + */ mapData?: any; - /** Specifies a data source for the map markers. */ + /** + * Specifies a data source for the map markers. + * @deprecated Use the 'layers.data' option instead + */ markers?: any; - /** An object specifying options for the map markers. */ + /** + * An object specifying options for the map markers. + * @deprecated Use the 'layers' option instead + */ markerSettings?: MarkerSettings; /** Specifies the size of the dxVectorMap widget. */ size?: viz.core.Size; + /** Specifies a title for the vector map. */ + title?: viz.core.Title; /** Specifies tooltip options. */ tooltip?: viz.core.Tooltip; /** Configures map legends. */ @@ -6356,7 +7038,6 @@ declare module DevExpress.viz.map { zoomingEnabled?: boolean; /** Specifies the geographical coordinates of the center for a map. */ center?: Array; - centerChanged?: (center: Array) => void; /** A handler for the centerChanged event. */ onCenterChanged?: (e: { center: Array; @@ -6379,27 +7060,43 @@ declare module DevExpress.viz.map { zoomFactor?: number; /** Specifies a map's maximum zoom factor. */ maxZoomFactor?: number; - zoomFactorChanged?: (zoomFactor: number) => void; /** A handler for the zoomFactorChanged event. */ onZoomFactorChanged?: (e: { - zoomFactor: number; component: dxVectorMap; element: Element; + zoomFactor: number; }) => void; - click?: any; /** A handler for the click event. */ onClick?: any; - /** A handler for the areaClick event. */ + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxVectorMap; + element: Element; + target: MapLayerElement; + }) => void; + /** + * A handler for the areaClick event. + * @deprecated Use the 'onClick' option instead + */ onAreaClick?: any; - /** A handler for the areaSelectionChanged event. */ + /** + * A handler for the areaSelectionChanged event. + * @deprecated Use the 'onSelectionChanged' option instead + */ onAreaSelectionChanged?: (e: { target: Area; component: dxVectorMap; element: Element; }) => void; - /** A handler for the markerClick event. */ + /** + * A handler for the markerClick event. + * @deprecated Use the 'onClick' option instead + */ onMarkerClick?: any; - /** A handler for the markerSelectionChanged event. */ + /** + * A handler for the markerSelectionChanged event. + * @deprecated Use the 'onSelecitonChanged' option instead + */ onMarkerSelectionChanged?: (e: { target: Marker; component: dxVectorMap; @@ -6409,12 +7106,19 @@ declare module DevExpress.viz.map { panningEnabled?: boolean; } export interface Legend extends viz.core.BaseLegend { + /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ + markerColor?: string; /** Specifies text for legend items. */ customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; /** Specifies the source of data for the legend. */ - source?: string; + source?: { + /** Specifies a layer to which the legend belongs. */ + layer?: string; + /** Specifies the type of the legend grouping. */ + grouping?: string; + } } /** A vector map widget. */ export class dxVectorMap extends viz.core.BaseWidget { @@ -6430,17 +7134,35 @@ declare module DevExpress.viz.map { center(): Array; /** Sets the coordinates of the map center. */ center(centerCoordinates: Array): void; - /** Deselects all the selected areas on a map. The areas are displayed in their initial style after. */ + /** + * Deselects all the selected areas on a map. The areas are displayed in their initial style after. + * @deprecated Use the 'clearSelection' method on a layer instead + */ clearAreaSelection(): void; - /** Deselects all the selected markers on a map. The markers are displayed in their initial style after. */ + /** + * Deselects all the selected markers on a map. The markers are displayed in their initial style after. + * @deprecated Use the 'clearSelection' method on a layer instead + */ clearMarkerSelection(): void; /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ clearSelection(): void; /** Converts client area coordinates into map coordinates. */ convertCoordinates(x: number, y: number): Array; - /** Returns an array with all the map areas. */ + /** Gets all map layers. */ + getLayers(): Array; + /** Gets the layer by its index. */ + getLayerByIndex(index: number): MapLayer; + /** Gets the layer by its name. */ + getLayerByName(name: string): MapLayer; + /** + * Returns an array with all the map areas. + * @deprecated Use the 'getElements' method on a layer instead + */ getAreas(): Array; - /** Returns an array with all the map markers. */ + /** + * Returns an array with all the map markers. + * @deprecated Use the 'getElements' method on a layer instead + */ getMarkers(): Array; /** Gets the current coordinates of the map viewport. */ viewport(): Array; @@ -6451,6 +7173,19 @@ declare module DevExpress.viz.map { /** Sets the value of the map zoom factor. */ zoomFactor(zoomFactor: number): void; } + export var projection: ProjectionCreator; + export interface ProjectionCreator { + /** Creates a new projection. */ + (data: { + to?: (coordinates: Array) => Array; + from?: (coordinates: Array) => Array; + aspectRatio?: number; + }): Object; + /** Gets the default or custom projection from the projection storage. */ + get(name: string): Object; + /** Adds a new projection to the internal projections storage. */ + add(name: string, projection: Object): void; + } } interface JQuery { dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; From 44474f1af32f15eda11142ca4898cab3c596200c Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Thu, 3 Dec 2015 13:49:21 +0100 Subject: [PATCH 051/134] update --- foundation-sites/foundation-tests.ts | 57 +++++++++++++++++++++++++++- foundation-sites/foundation.d.ts | 48 ++++++++++++----------- npm-debug.log | 45 ++++++++++++++++++++++ 3 files changed, 127 insertions(+), 23 deletions(-) create mode 100644 npm-debug.log diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts index f7da5e49c..54da9fb79 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-tests.ts @@ -1,7 +1,6 @@ // Tests for type definitions for Foundation Sites v6.0.4 // Project: http://foundation.zurb.com/ // Definitions by: Sam Vloeberghs -// Definitions by: Michał Wrześniewski // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -11,6 +10,60 @@ $(document).foundation(); $(document).foundation('method'); $(document).foundation(['method', 'method2']); + + Foundation.Abide.($('.selector')); + Foundation.Abide.($('.selector'), {}); +/* + Foundation.Accordion.($('.selector')); + Foundation.Accordion.($('.selector'), {}); + + Foundation.AccordionMenu.($('.selector')); + Foundation.AccordionMenu.($('.selector'), {}); + + Foundation.DrillDown.($('.selector')); + Foundation.DrillDown.($('.selector'), {}); + + Foundation.Dropdown.($('.selector')); + Foundation.Dropdown.($('.selector'), {}); + + Foundation.DropdownMenu.($('.selector')); + Foundation.DropdownMenu.($('.selector'), {}); + + Foundation.Equalizer.($('.selector')); + Foundation.Equalizer.($('.selector'), {}); + + Foundation.Interchange.($('.selector')); + Foundation.Interchange.($('.selector'), {}); + + Foundation.Magellan.($('.selector')); + Foundation.Magellan.($('.selector'), {}); + + Foundation.OffCanvas.($('.selector')); + Foundation.OffCanvas.($('.selector'), {}); + + Foundation.Orbit.($('.selector')); + Foundation.Orbit.($('.selector'), {}); + + Foundation.Reveal.($('.selector')); + Foundation.Reveal.($('.selector'), {}); + + Foundation.Slider.($('.selector')); + Foundation.Slider.($('.selector'), {}); + + Foundation.Sticky.($('.selector')); + Foundation.Sticky.($('.selector'), {}); + + Foundation.Tabs.($('.selector')); + Foundation.Tabs.($('.selector'), {}); + + Foundation.Toggler.($('.selector')); + Foundation.Toggler.($('.selector'), {}); + + Foundation.Tooltip.($('.selector')); + Foundation.Tooltip.($('.selector'), {}); + */ + +/* function pluginList() { 'use strict'; @@ -40,3 +93,5 @@ pluginList().forEach((value:String) => { Foundation[value].($('.selector')); Foundation[value].($('.selector'), {}); }); + +*/ diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts index bcd012ec9..3ec7f344e 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation.d.ts @@ -1,7 +1,6 @@ // Type definitions for Foundation Sites v6.0.4 // Project: http://foundation.zurb.com/ // Definitions by: Sam Vloeberghs -// Definitions by: Michał Wrześniewski // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -18,10 +17,10 @@ declare module Foundation { validateForm(element:Object): void; validateText(element:Object): boolean; validateRadio(group:String): boolean; - resetform($form:Object): void; + resetForm($form:Object): void; } - export interface IAbidePatterns { + interface IAbidePatterns { alpha?: RegExp; alpha_numeric?: RegExp; integer?: RegExp; @@ -40,8 +39,8 @@ declare module Foundation { color?: RegExp; } - export interface IAbideOptions { - slideSpeed?: number + interface IAbideOptions { + slideSpeed?: number; multiOpen?: boolean; patters?: Foundation.IAbidePatterns; } @@ -54,7 +53,7 @@ declare module Foundation { destroy(): void; } - export interface IAccordionOptions { + interface IAccordionOptions { slideSpeed?: number multiOpen?: boolean; } @@ -67,7 +66,7 @@ declare module Foundation { destroy(): void; } - export interface IAccordionMenuOptions { + interface IAccordionMenuOptions { slideSpeed?: number; multiOpen?: boolean; } @@ -80,7 +79,7 @@ declare module Foundation { destroy(): void; } - export interface IDrilldownOptions { + interface IDrilldownOptions { backButton?: String; wrapper?: String closeOnClick?: boolean @@ -95,7 +94,7 @@ declare module Foundation { destroy(): void; } - export interface IDropdownOptions { + interface IDropdownOptions { hoverDelay?: number; hover?: boolean; vOffset?: number; @@ -110,7 +109,7 @@ declare module Foundation { destroy(): void; } - export interface IDropdownMenuOptions { + interface IDropdownMenuOptions { disableHover?: boolean; autoclose?: boolean; hoverDelay?: number; @@ -128,7 +127,7 @@ declare module Foundation { destroy(): void; } - export interface IEqualizerOptions { + interface IEqualizerOptions { equalizeOnStack?: boolean; throttleInterval?: number; } @@ -139,7 +138,7 @@ declare module Foundation { destroy(): void; } - export interface IInterchangeOptions { + interface IInterchangeOptions { rules?: Array } @@ -150,7 +149,7 @@ declare module Foundation { destroy(): void; } - export interface IMagellanOptions { + interface IMagellanOptions { animationDuration?: number; animationEasing?: String; threshold?: number; @@ -166,7 +165,7 @@ declare module Foundation { destroy(): void; } - export interface IOffCanvasOptions { + interface IOffCanvasOptions { closeOnClick?: boolean; transitionTime?: number; position?: String; @@ -184,7 +183,7 @@ declare module Foundation { destroy(): void; } - export interface IOrbitOptions { + interface IOrbitOptions { bullets?: boolean; navButtons?: boolean; animInFromRight?: String; @@ -212,7 +211,7 @@ declare module Foundation { destroy(): void; } - export interface IRevealOptions { + interface IRevealOptions { animationIn?: String; animationOut?: String; showDelay?: number; @@ -233,7 +232,7 @@ declare module Foundation { destroy(): void; } - export interface ISliderOptions { + interface ISliderOptions { start?: number; end?: number; step?: number; @@ -258,7 +257,7 @@ declare module Foundation { emCalc(number:any): void; } - export interface IStickyOptions { + interface IStickyOptions { container?: String; stickTo?: String; anchor?: String; @@ -279,7 +278,7 @@ declare module Foundation { destroy(): void; } - export interface ITabsOptions { + interface ITabsOptions { animate?: boolean; } @@ -289,7 +288,7 @@ declare module Foundation { destroy(): void; } - export interface ITogglerOptions { + interface ITogglerOptions { animate?: boolean; } @@ -301,7 +300,7 @@ declare module Foundation { destroy(): void; } - export interface ITooltipOptions { + interface ITooltipOptions { hoverDelay?: number; fadeInDuration?: number; fadeOutDuration?: number; @@ -381,7 +380,7 @@ declare module Foundation { transitionend(): String; util : { - throttle(func:(...args:any[]) => any, delay:number) (...args:any[]) => any; + throttle(func:(...args:any[]) => any, delay:number): (...args:any[]) => any; }; onImagesLoaded(images:Object, cb:Function): void; @@ -415,6 +414,7 @@ declare module Foundation { Triggers: Foundation.Triggers; } + } interface JQuery { @@ -422,3 +422,7 @@ interface JQuery { } declare var Foundation:Foundation.FoundationStatic; + +declare module "Foundation" { + export = Foundation; +} diff --git a/npm-debug.log b/npm-debug.log new file mode 100644 index 000000000..19dc7e7fd --- /dev/null +++ b/npm-debug.log @@ -0,0 +1,45 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/Cellar/node/4.2.1/bin/node', +1 verbose cli '/usr/local/bin/npm', +1 verbose cli 'run', +1 verbose cli 'test' ] +2 info using npm@3.3.9 +3 info using node@v4.2.1 +4 verbose run-script [ 'pretest', 'test', 'posttest' ] +5 info lifecycle DefinitelyTyped@0.0.1~pretest: DefinitelyTyped@0.0.1 +6 silly lifecycle DefinitelyTyped@0.0.1~pretest: no script for pretest, continuing +7 info lifecycle DefinitelyTyped@0.0.1~test: DefinitelyTyped@0.0.1 +8 verbose lifecycle DefinitelyTyped@0.0.1~test: unsafe-perm in lifecycle true +9 verbose lifecycle DefinitelyTyped@0.0.1~test: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Volumes/Data/Kwerri/playground/DefinitelyTyped/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin +10 verbose lifecycle DefinitelyTyped@0.0.1~test: CWD: /Volumes/Data/Kwerri/playground/DefinitelyTyped +11 silly lifecycle DefinitelyTyped@0.0.1~test: Args: [ '-c', 'dt --changes' ] +12 silly lifecycle DefinitelyTyped@0.0.1~test: Returned: code: 1 signal: null +13 info lifecycle DefinitelyTyped@0.0.1~test: Failed to exec test script +14 verbose stack Error: DefinitelyTyped@0.0.1 test: `dt --changes` +14 verbose stack Exit status 1 +14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:233:16) +14 verbose stack at emitTwo (events.js:87:13) +14 verbose stack at EventEmitter.emit (events.js:172:7) +14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) +14 verbose stack at emitTwo (events.js:87:13) +14 verbose stack at ChildProcess.emit (events.js:172:7) +14 verbose stack at maybeClose (internal/child_process.js:818:16) +14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) +15 verbose pkgid DefinitelyTyped@0.0.1 +16 verbose cwd /Volumes/Data/Kwerri/playground/DefinitelyTyped +17 error Darwin 15.0.0 +18 error argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "run" "test" +19 error node v4.2.1 +20 error npm v3.3.9 +21 error code ELIFECYCLE +22 error DefinitelyTyped@0.0.1 test: `dt --changes` +22 error Exit status 1 +23 error Failed at the DefinitelyTyped@0.0.1 test script 'dt --changes'. +23 error This is most likely a problem with the DefinitelyTyped package, +23 error not with npm itself. +23 error Tell the author that this fails on your system: +23 error dt --changes +23 error You can get their info via: +23 error npm owner ls DefinitelyTyped +23 error There is likely additional logging output above. +24 verbose exit [ 1, true ] From 3ff68ab822646d166995d02c40dd9ba97586d93f Mon Sep 17 00:00:00 2001 From: Per Kastman Date: Thu, 3 Dec 2015 14:26:25 +0100 Subject: [PATCH 052/134] Added possibility to register for events --- jquery-cropbox/jquery-cropbox-tests.ts | 6 ++++++ jquery-cropbox/jquery-cropbox.d.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/jquery-cropbox/jquery-cropbox-tests.ts b/jquery-cropbox/jquery-cropbox-tests.ts index e8db3847c..270802cd9 100644 --- a/jquery-cropbox/jquery-cropbox-tests.ts +++ b/jquery-cropbox/jquery-cropbox-tests.ts @@ -37,3 +37,9 @@ cropboxWithOptions.update(); cropboxWithOptions.getDataURL(); cropboxWithOptions.getBlob(); cropboxWithOptions.remove(); + +cropboxWithOptions.on("cropbox",(e: Event, data: any, img: jQueryCropBox.Cropbox) => { + + //DoStuff + +}); \ No newline at end of file diff --git a/jquery-cropbox/jquery-cropbox.d.ts b/jquery-cropbox/jquery-cropbox.d.ts index 82b550bf3..9f91e06a2 100644 --- a/jquery-cropbox/jquery-cropbox.d.ts +++ b/jquery-cropbox/jquery-cropbox.d.ts @@ -103,7 +103,13 @@ declare module jQueryCropBox { * Remove the cropbox functionality from the image. */ remove(): void; + /** + * Attach an event handler function for one event on the Crop Box + */ + on(event: string, callback: jQueryCropBox.EventCallback): void; } + + type EventCallback = (e: Event, data: any, img: jQueryCropBox.Cropbox) => void; } interface JQuery { From 60caa355e54203f3880bbbdce05af9627ada0b5e Mon Sep 17 00:00:00 2001 From: Michael Tiller Date: Thu, 3 Dec 2015 08:29:49 -0500 Subject: [PATCH 053/134] Including types from angular-ui-router This change to the module definition allows both classic CommonJS imports as well as new ES6 style imports, e.g. import { IState } from 'angular-ui-router'; --- angular-ui-router/angular-ui-router.d.ts | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index 014baf5ac..257446f69 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -5,10 +5,27 @@ /// -// Support for AMD require +// Support for AMD require and CommonJS declare module 'angular-ui-router' { - var _: string; - export = _; + // Since angular-ui-router adds providers for a bunch of + // injectable dependencies, it doesn't really return any + // actual data except the plain string 'ui.router'. + // + // As such, I don't think anybody will ever use the actual + // default value of the module. So I've only included the + // the types. (@xogeny) + export type IState = angular.ui.IState; + export type IStateProvider = angular.ui.IStateProvider; + export type IUrlMatcher = angular.ui.IUrlMatcher; + export type IUrlRouterProvider = angular.ui.IUrlRouterProvider; + export type IStateOptions = angular.ui.IStateOptions; + export type IHrefOptions = angular.ui.IHrefOptions; + export type IStateService = angular.ui.IStateService; + export type IResolvedState = angular.ui.IResolvedState; + export type IStateParamsService = angular.ui.IStateParamsService; + export type IUrlRouterService = angular.ui.IUrlRouterService; + export type IUiViewScrollProvider = angular.ui.IUiViewScrollProvider; + export type IType = angular.ui.IType; } declare module angular.ui { From 3ec3169f642ef2970422bf38298c11cd8eaaf33e Mon Sep 17 00:00:00 2001 From: James O'Cull Date: Thu, 3 Dec 2015 09:55:13 -0500 Subject: [PATCH 054/134] Commit / Rollback on Transaction interface should return promise --- sequelize/sequelize.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sequelize/sequelize.d.ts b/sequelize/sequelize.d.ts index 9b5e935bf..46a0ba41a 100644 --- a/sequelize/sequelize.d.ts +++ b/sequelize/sequelize.d.ts @@ -5706,12 +5706,12 @@ declare module "sequelize" { /** * Commit the transaction */ - commit() : Transaction; + commit() : Promise; /** * Rollback (abort) the transaction */ - rollback() : Transaction; + rollback() : Promise; } From 06509c824951af47ddd2853cb4fb9bbb76152eb3 Mon Sep 17 00:00:00 2001 From: brnls Date: Thu, 3 Dec 2015 09:19:21 -0800 Subject: [PATCH 055/134] Fix Observable Array sort/reverse return type --- knockout/knockout.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 8f5d6fef4..883ed43b7 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -30,9 +30,9 @@ interface KnockoutObservableArrayFunctions { push(...items: T[]): void; shift(): T; unshift(...items: T[]): number; - reverse(): T[]; - sort(): void; - sort(compareFunction: (left: T, right: T) => number): void; + reverse(): KnockoutObservableArray; + sort(): KnockoutObservableArray; + sort(compareFunction: (left: T, right: T) => number): KnockoutObservableArray; // Ko specific [key: string]: KnockoutBindingHandler; From 7fb9bf8417f91f68c896eae9a2351493e9122aeb Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Thu, 3 Dec 2015 19:24:06 +0200 Subject: [PATCH 056/134] google-maps definitions added --- google-maps/google-maps.d.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 google-maps/google-maps.d.ts diff --git a/google-maps/google-maps.d.ts b/google-maps/google-maps.d.ts new file mode 100644 index 000000000..753aa4f49 --- /dev/null +++ b/google-maps/google-maps.d.ts @@ -0,0 +1,26 @@ +// Type definitions for google-maps 3.1.0 +// Project: https://www.npmjs.com/package/google-maps +// Definitions by: Deividas Bakanas , Giedrius Grabauskas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace GoogleMapsLoader { + interface CallBack { + (google: { maps: { Map: google.maps.Map } }): void; + } + export var KEY: string; + export var CLIENT: string; + export var VERSION: string; + export var SENSO: boolean; + export var LIBRARIES: Array; + export var LANGUAGE: string; + export function release(callBack: Function): void; + export function onLoad(callBack?: CallBack): void; + export function load(callBack?: CallBack): void; + export function isLoaded(): boolean; + +} +declare module 'google-maps' { + export = GoogleMapsLoader; +} From f3dcb689eaf3fc8f903051766cdc0791e97c5783 Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Thu, 3 Dec 2015 19:30:27 +0200 Subject: [PATCH 057/134] Created google-maps-tests file. --- google-maps/google-maps-tests.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 google-maps/google-maps-tests.ts diff --git a/google-maps/google-maps-tests.ts b/google-maps/google-maps-tests.ts new file mode 100644 index 000000000..2256b254b --- /dev/null +++ b/google-maps/google-maps-tests.ts @@ -0,0 +1,26 @@ +/// + +var GoogleMapsLoader = require('google-maps'); + +GoogleMapsLoader.load(function(google) { + new google.maps.Map(el, options); +}); + +GoogleMapsLoader.KEY = 'qwertyuiopasdfghjklzxcvbnm'; + +GoogleMapsLoader.CLIENT = 'yourclientkey'; +GoogleMapsLoader.VERSION = '3.14'; + +GoogleMapsLoader.SENSOR = true + +GoogleMapsLoader.LIBRARIES = ['geometry', 'places']; + +GoogleMapsLoader.LANGUAGE = 'fr'; + +GoogleMapsLoader.release(function() { + console.log('No google maps api around'); +}); + +GoogleMapsLoader.onLoad(function(google) { + console.log('I just loaded google maps api'); +}); From 64dc5896a52b88fbff3b793e3c71236f1692ed35 Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Thu, 3 Dec 2015 19:31:49 +0200 Subject: [PATCH 058/134] Edited authors links. --- google-maps/google-maps.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-maps/google-maps.d.ts b/google-maps/google-maps.d.ts index 753aa4f49..6c528c6ef 100644 --- a/google-maps/google-maps.d.ts +++ b/google-maps/google-maps.d.ts @@ -1,6 +1,6 @@ // Type definitions for google-maps 3.1.0 // Project: https://www.npmjs.com/package/google-maps -// Definitions by: Deividas Bakanas , Giedrius Grabauskas +// Definitions by: Deividas Bakanas , Giedrius Grabauskas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 50170b0b7a64cfc655177a953e71210d7f8c13c1 Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Thu, 3 Dec 2015 19:36:53 +0200 Subject: [PATCH 059/134] Fixed import. --- google-maps/google-maps-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-maps/google-maps-tests.ts b/google-maps/google-maps-tests.ts index 2256b254b..16f917b40 100644 --- a/google-maps/google-maps-tests.ts +++ b/google-maps/google-maps-tests.ts @@ -1,6 +1,6 @@ /// -var GoogleMapsLoader = require('google-maps'); +import GoogleMapsLoader = require('google-maps'); GoogleMapsLoader.load(function(google) { new google.maps.Map(el, options); From 91f11851435d731dc7e5524b32d0064d21fa90d9 Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Thu, 3 Dec 2015 19:39:56 +0200 Subject: [PATCH 060/134] Fixed tests. --- google-maps/google-maps-tests.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/google-maps/google-maps-tests.ts b/google-maps/google-maps-tests.ts index 16f917b40..50f848936 100644 --- a/google-maps/google-maps-tests.ts +++ b/google-maps/google-maps-tests.ts @@ -3,7 +3,7 @@ import GoogleMapsLoader = require('google-maps'); GoogleMapsLoader.load(function(google) { - new google.maps.Map(el, options); + var loadedMap = google.maps.Map; }); GoogleMapsLoader.KEY = 'qwertyuiopasdfghjklzxcvbnm'; @@ -11,7 +11,7 @@ GoogleMapsLoader.KEY = 'qwertyuiopasdfghjklzxcvbnm'; GoogleMapsLoader.CLIENT = 'yourclientkey'; GoogleMapsLoader.VERSION = '3.14'; -GoogleMapsLoader.SENSOR = true +GoogleMapsLoader.SENSOR = true; GoogleMapsLoader.LIBRARIES = ['geometry', 'places']; @@ -22,5 +22,6 @@ GoogleMapsLoader.release(function() { }); GoogleMapsLoader.onLoad(function(google) { + var loadedMap = google.maps.Map; console.log('I just loaded google maps api'); }); From c21a2d49821b1a7d882b85e72255cdcf1532d1a3 Mon Sep 17 00:00:00 2001 From: Deividas Bakanas Date: Thu, 3 Dec 2015 19:40:25 +0200 Subject: [PATCH 061/134] Fixed definition mistype. --- google-maps/google-maps.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-maps/google-maps.d.ts b/google-maps/google-maps.d.ts index 6c528c6ef..edc37822c 100644 --- a/google-maps/google-maps.d.ts +++ b/google-maps/google-maps.d.ts @@ -12,7 +12,7 @@ declare namespace GoogleMapsLoader { export var KEY: string; export var CLIENT: string; export var VERSION: string; - export var SENSO: boolean; + export var SENSOR: boolean; export var LIBRARIES: Array; export var LANGUAGE: string; export function release(callBack: Function): void; From 5ff03e2f4153ba30e5418e7dcd6200fa81a108b6 Mon Sep 17 00:00:00 2001 From: James O'Cull Date: Thu, 3 Dec 2015 14:30:10 -0500 Subject: [PATCH 062/134] Changes to unify transaction support across various interfaces, especially association mixins --- sequelize/sequelize.d.ts | 166 ++++++++++++++------------------------- 1 file changed, 58 insertions(+), 108 deletions(-) diff --git a/sequelize/sequelize.d.ts b/sequelize/sequelize.d.ts index 46a0ba41a..74f682e27 100644 --- a/sequelize/sequelize.d.ts +++ b/sequelize/sequelize.d.ts @@ -19,13 +19,12 @@ declare module "sequelize" { // // https://github.com/sequelize/sequelize/tree/v3.4.1/lib/associations // - - + /** * The options for the getAssociation mixin of the belongsTo association. * @see BelongsToGetAssociationMixin */ - interface BelongsToGetAssociationMixinOptions { + interface BelongsToGetAssociationMixinOptions extends Transactable { /** * Apply a scope on the related model, or remove its default scope by passing false. */ @@ -62,7 +61,7 @@ declare module "sequelize" { * The options for the setAssociation mixin of the belongsTo association. * @see BelongsToSetAssociationMixin */ - interface BelongsToSetAssociationMixinOptions { + interface BelongsToSetAssociationMixinOptions extends Transactable { /** * Skip saving this after setting the foreign key if false. */ @@ -103,7 +102,7 @@ declare module "sequelize" { * The options for the createAssociation mixin of the belongsTo association. * @see BelongsToCreateAssociationMixin */ - interface BelongsToCreateAssociationMixinOptions { } + interface BelongsToCreateAssociationMixinOptions extends Transactable { } /** * The createAssociation mixin applied to models with belongsTo. @@ -139,7 +138,7 @@ declare module "sequelize" { * The options for the getAssociation mixin of the hasOne association. * @see HasOneGetAssociationMixin */ - interface HasOneGetAssociationMixinOptions { + interface HasOneGetAssociationMixinOptions extends Transactable { /** * Apply a scope on the related model, or remove its default scope by passing false. */ @@ -176,7 +175,7 @@ declare module "sequelize" { * The options for the setAssociation mixin of the hasOne association. * @see HasOneSetAssociationMixin */ - interface HasOneSetAssociationMixinOptions { + interface HasOneSetAssociationMixinOptions extends Transactable { /** * Skip saving this after setting the foreign key if false. */ @@ -217,7 +216,7 @@ declare module "sequelize" { * The options for the createAssociation mixin of the hasOne association. * @see HasOneCreateAssociationMixin */ - interface HasOneCreateAssociationMixinOptions { } + interface HasOneCreateAssociationMixinOptions extends Transactable { } /** * The createAssociation mixin applied to models with hasOne. @@ -253,7 +252,7 @@ declare module "sequelize" { * The options for the getAssociations mixin of the hasMany association. * @see HasManyGetAssociationsMixin */ - interface HasManyGetAssociationsMixinOptions { + interface HasManyGetAssociationsMixinOptions extends Transactable { /** * An optional where clause to limit the associated models. @@ -303,7 +302,7 @@ declare module "sequelize" { * The options for the setAssociations mixin of the hasMany association. * @see HasManySetAssociationsMixin */ - interface HasManySetAssociationsMixinOptions { + interface HasManySetAssociationsMixinOptions extends Transactable { /** * Run validation for the join model. @@ -353,7 +352,7 @@ declare module "sequelize" { * The options for the addAssociations mixin of the hasMany association. * @see HasManyAddAssociationsMixin */ - interface HasManyAddAssociationsMixinOptions { + interface HasManyAddAssociationsMixinOptions extends Transactable { /** * Run validation for the join model. @@ -402,7 +401,7 @@ declare module "sequelize" { * The options for the addAssociation mixin of the hasMany association. * @see HasManyAddAssociationMixin */ - interface HasManyAddAssociationMixinOptions { + interface HasManyAddAssociationMixinOptions extends Transactable { /** * Run validation for the join model. @@ -451,7 +450,7 @@ declare module "sequelize" { * The options for the createAssociation mixin of the hasMany association. * @see HasManyCreateAssociationMixin */ - interface HasManyCreateAssociationMixinOptions { } + interface HasManyCreateAssociationMixinOptions extends Transactable { } /** * The createAssociation mixin applied to models with hasMany. @@ -494,7 +493,7 @@ declare module "sequelize" { * The options for the removeAssociation mixin of the hasMany association. * @see HasManyRemoveAssociationMixin */ - interface HasManyRemoveAssociationMixinOptions { } + interface HasManyRemoveAssociationMixinOptions extends Transactable { } /** * The removeAssociation mixin applied to models with hasMany. @@ -537,7 +536,7 @@ declare module "sequelize" { * The options for the removeAssociations mixin of the hasMany association. * @see HasManyRemoveAssociationsMixin */ - interface HasManyRemoveAssociationsMixinOptions { } + interface HasManyRemoveAssociationsMixinOptions extends Transactable { } /** * The removeAssociations mixin applied to models with hasMany. @@ -580,7 +579,7 @@ declare module "sequelize" { * The options for the hasAssociation mixin of the hasMany association. * @see HasManyHasAssociationMixin */ - interface HasManyHasAssociationMixinOptions { } + interface HasManyHasAssociationMixinOptions extends Transactable { } /** * The hasAssociation mixin applied to models with hasMany. @@ -623,7 +622,7 @@ declare module "sequelize" { * The options for the hasAssociations mixin of the hasMany association. * @see HasManyHasAssociationsMixin */ - interface HasManyHasAssociationsMixinOptions { } + interface HasManyHasAssociationsMixinOptions extends Transactable { } /** * The removeAssociations mixin applied to models with hasMany. @@ -666,7 +665,7 @@ declare module "sequelize" { * The options for the countAssociations mixin of the hasMany association. * @see HasManyCountAssociationsMixin */ - interface HasManyCountAssociationsMixinOptions { + interface HasManyCountAssociationsMixinOptions extends Transactable { /** * An optional where clause to limit the associated models. @@ -716,7 +715,7 @@ declare module "sequelize" { * The options for the getAssociations mixin of the belongsToMany association. * @see BelongsToManyGetAssociationsMixin */ - interface BelongsToManyGetAssociationsMixinOptions { + interface BelongsToManyGetAssociationsMixinOptions extends Transactable { /** * An optional where clause to limit the associated models. @@ -766,7 +765,7 @@ declare module "sequelize" { * The options for the setAssociations mixin of the belongsToMany association. * @see BelongsToManySetAssociationsMixin */ - interface BelongsToManySetAssociationsMixinOptions { + interface BelongsToManySetAssociationsMixinOptions extends Transactable { /** * Run validation for the join model. @@ -816,7 +815,7 @@ declare module "sequelize" { * The options for the addAssociations mixin of the belongsToMany association. * @see BelongsToManyAddAssociationsMixin */ - interface BelongsToManyAddAssociationsMixinOptions { + interface BelongsToManyAddAssociationsMixinOptions extends Transactable { /** * Run validation for the join model. @@ -865,7 +864,7 @@ declare module "sequelize" { * The options for the addAssociation mixin of the belongsToMany association. * @see BelongsToManyAddAssociationMixin */ - interface BelongsToManyAddAssociationMixinOptions { + interface BelongsToManyAddAssociationMixinOptions extends Transactable { /** * Run validation for the join model. @@ -914,7 +913,7 @@ declare module "sequelize" { * The options for the createAssociation mixin of the belongsToMany association. * @see BelongsToManyCreateAssociationMixin */ - interface BelongsToManyCreateAssociationMixinOptions { } + interface BelongsToManyCreateAssociationMixinOptions extends Transactable { } /** * The createAssociation mixin applied to models with belongsToMany. @@ -957,7 +956,7 @@ declare module "sequelize" { * The options for the removeAssociation mixin of the belongsToMany association. * @see BelongsToManyRemoveAssociationMixin */ - interface BelongsToManyRemoveAssociationMixinOptions { } + interface BelongsToManyRemoveAssociationMixinOptions extends Transactable { } /** * The removeAssociation mixin applied to models with belongsToMany. @@ -1000,7 +999,7 @@ declare module "sequelize" { * The options for the removeAssociations mixin of the belongsToMany association. * @see BelongsToManyRemoveAssociationsMixin */ - interface BelongsToManyRemoveAssociationsMixinOptions { } + interface BelongsToManyRemoveAssociationsMixinOptions extends Transactable { } /** * The removeAssociations mixin applied to models with belongsToMany. @@ -1043,7 +1042,7 @@ declare module "sequelize" { * The options for the hasAssociation mixin of the belongsToMany association. * @see BelongsToManyHasAssociationMixin */ - interface BelongsToManyHasAssociationMixinOptions { } + interface BelongsToManyHasAssociationMixinOptions extends Transactable { } /** * The hasAssociation mixin applied to models with belongsToMany. @@ -1086,7 +1085,7 @@ declare module "sequelize" { * The options for the hasAssociations mixin of the belongsToMany association. * @see BelongsToManyHasAssociationsMixin */ - interface BelongsToManyHasAssociationsMixinOptions { } + interface BelongsToManyHasAssociationsMixinOptions extends Transactable { } /** * The removeAssociations mixin applied to models with belongsToMany. @@ -1129,7 +1128,7 @@ declare module "sequelize" { * The options for the countAssociations mixin of the belongsToMany association. * @see BelongsToManyCountAssociationsMixin */ - interface BelongsToManyCountAssociationsMixinOptions { + interface BelongsToManyCountAssociationsMixinOptions extends Transactable { /** * An optional where clause to limit the associated models. @@ -2538,7 +2537,7 @@ declare module "sequelize" { /** * Options used for Instance.increment method */ - interface InstanceIncrementDecrementOptions { + interface InstanceIncrementDecrementOptions extends Transactable { /** * The number to increment by @@ -2552,39 +2551,29 @@ declare module "sequelize" { */ logging? : boolean | Function; - /** - * Transaction to run query under - */ - transaction? : Transaction; - /** * A hash of attributes to describe your search. See above for examples. */ where? : WhereOptions | Array; - + } /** * Options used for Instance.restore method */ - interface InstanceRestoreOptions { + interface InstanceRestoreOptions extends Transactable { /** * A function that gets executed while running the query to log the sql. */ logging? : boolean | Function; - - /** - * Transaction to run query under - */ - transaction? : Transaction; - + } /** * Options used for Instance.destroy method */ - interface InstanceDestroyOptions { + interface InstanceDestroyOptions extends Transactable { /** * If set to true, paranoid models will actually be deleted @@ -2595,12 +2584,7 @@ declare module "sequelize" { * A function that gets executed while running the query to log the sql. */ logging? : boolean | Function; - - /** - * Transaction to run the query in - */ - transaction? : Transaction; - + } /** @@ -2635,7 +2619,7 @@ declare module "sequelize" { /** * Options used for Instance.save method */ - interface InstanceSaveOptions { + interface InstanceSaveOptions extends Transactable { /** * An optional array of strings, representing database columns. If fields is provided, only those columns @@ -2661,12 +2645,7 @@ declare module "sequelize" { * A function that gets executed while running the query to log the sql. */ logging? : boolean | Function; - - /** - * Transaction to run the query in - */ - transaction? : Transaction; - + } /** @@ -3091,7 +3070,7 @@ declare module "sequelize" { * * A hash of options to describe the scope of the search */ - interface FindOptions { + interface FindOptions extends Transactable { /** * A hash of attributes to describe your search. See above for examples. @@ -3138,11 +3117,6 @@ declare module "sequelize" { */ offset?: number; - /** - * Transaction to run query under - */ - transaction? : Transaction; - /** * Lock the selected rows. Possible options are transaction.LOCK.UPDATE and transaction.LOCK.SHARE. * Postgres also supports transaction.LOCK.KEY_SHARE, transaction.LOCK.NO_KEY_UPDATE and specific model @@ -3170,7 +3144,7 @@ declare module "sequelize" { /** * Options for Model.count method */ - interface CountOptions { + interface CountOptions extends Transactable { /** * A hash of search attributes. @@ -3203,8 +3177,7 @@ declare module "sequelize" { * A function that gets executed while running the query to log the sql. */ logging? : boolean | Function; - - transaction?: Transaction; + } /** @@ -3234,7 +3207,7 @@ declare module "sequelize" { /** * Options for Model.create method */ - interface CreateOptions extends BuildOptions { + interface CreateOptions extends BuildOptions, Transactable { /** * If set, only columns matching those in fields will be saved @@ -3246,11 +3219,6 @@ declare module "sequelize" { */ onDuplicate? : string; - /** - * Transaction to run query under - */ - transaction? : Transaction; - /** * A function that gets executed while running the query to log the sql. */ @@ -3259,12 +3227,13 @@ declare module "sequelize" { silent? : boolean; returning? : boolean; + } /** * Options for Model.findOrInitialize method */ - interface FindOrInitializeOptions { + interface FindOrInitializeOptions extends Transactable { /** * A hash of search attributes. @@ -3276,11 +3245,6 @@ declare module "sequelize" { */ defaults? : TAttributes; - /** - * Transaction to run query under - */ - transaction? : Transaction; - /** * A function that gets executed while running the query to log the sql. */ @@ -3313,7 +3277,7 @@ declare module "sequelize" { /** * Options for Model.bulkCreate method */ - interface BulkCreateOptions { + interface BulkCreateOptions extends Transactable { /** * Fields to insert (defaults to all fields) @@ -3350,11 +3314,6 @@ declare module "sequelize" { */ updateOnDuplicate? : Array; - /** - * Transaction to run query under - */ - transaction? : Transaction; - /** * A function that gets executed while running the query to log the sql. */ @@ -3365,12 +3324,7 @@ declare module "sequelize" { /** * The options passed to Model.destroy in addition to truncate */ - interface TruncateOptions { - - /** - * Transaction to run query under - */ - transaction? : Transaction; + interface TruncateOptions extends Transactable { /** * Only used in conjuction with TRUNCATE. Truncates all tables that have foreign-key references to the @@ -3429,7 +3383,7 @@ declare module "sequelize" { /** * Options for Model.restore */ - interface RestoreOptions { + interface RestoreOptions extends Transactable { /** * Filter the restore @@ -3457,17 +3411,12 @@ declare module "sequelize" { */ logging? : boolean | Function; - /** - * Transaction to run query under - */ - transaction? : Transaction; - } /** * Options used for Model.update */ - interface UpdateOptions { + interface UpdateOptions extends Transactable { /** * Options to describe the scope of the search. @@ -3524,11 +3473,6 @@ declare module "sequelize" { */ logging? : boolean | Function; - /** - * Transaction to run query under - */ - transaction? : Transaction; - } /** @@ -4422,7 +4366,7 @@ declare module "sequelize" { * * @see Options */ - interface QueryOptions { + interface QueryOptions extends Transactable { /** * If true, sequelize will not try to format the results of the query, or build an instance of a model from @@ -4430,11 +4374,6 @@ declare module "sequelize" { */ raw?: boolean; - /** - * The transaction that the query should be executed under - */ - transaction?: Transaction; - /** * The type of query you are executing. The query type affects how results are formatted before they are * passed back. The type is a string, but `Sequelize.QueryTypes` is provided as convenience shortcuts. @@ -5838,7 +5777,18 @@ declare module "sequelize" { * A function that gets executed while running the query to log the sql. */ logging?: Function; - + } + + /** + * An interface that allows an item to support working under a transaction + * + * @param transaction Transaction The optional transaction to run under + */ + interface Transactable { + /** + * Transaction to run query under + */ + transaction?: Transaction; } // From 4f0c326e4553fc4b96d9560717e28473817699bb Mon Sep 17 00:00:00 2001 From: Vinh Tran Date: Thu, 3 Dec 2015 14:35:42 -0500 Subject: [PATCH 063/134] Update search request optional fields Update PlaceSearchRequest, RadarSearchRequest, and TextSearchRequest interfaces to better reflect their optional fields. Reference: https://developers.google.com/maps/documentation/javascript/places --- googlemaps/google.maps.d.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index 3ac35b048..770151f33 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -1917,16 +1917,16 @@ declare module google.maps { } export interface PlaceSearchRequest { - bounds: LatLngBounds; - keyword: string; - location: LatLng|LatLngLiteral; + bounds?: LatLngBounds; + keyword?: string; + location?: LatLng|LatLngLiteral; maxPriceLevel?: number; minPriceLevel?: number; - name: string; - openNow: boolean; - radius: number; - rankBy: RankBy; - types: string[]; + name?: string; + openNow?: boolean; + radius?: number; + rankBy?: RankBy; + types?: string[]; } export class PlacesService { @@ -1963,11 +1963,11 @@ declare module google.maps { export interface RadarSearchRequest { bounds?: LatLngBounds; - keyword: string; - location: LatLng|LatLngLiteral; - name: string; - radius: number; - types: string[]; + keyword?: string; + location?: LatLng|LatLngLiteral; + name?: string; + radius?: number; + types?: string[]; } export enum RankBy { @@ -1988,10 +1988,10 @@ declare module google.maps { export interface TextSearchRequest { bounds?: LatLngBounds; - location: LatLng|LatLngLiteral; + location?: LatLng|LatLngLiteral; query: string; - radius: number; - types: string[]; + radius?: number; + types?: string[]; } } From 2e5439d881f3e744175633c21c26a656fbc66763 Mon Sep 17 00:00:00 2001 From: James O'Cull Date: Thu, 3 Dec 2015 17:29:21 -0500 Subject: [PATCH 064/134] Revert "Changes to unify transaction support across various interfaces, especially association mixins" This reverts commit 5ff03e2f4153ba30e5418e7dcd6200fa81a108b6. --- sequelize/sequelize.d.ts | 166 +++++++++++++++++++++++++-------------- 1 file changed, 108 insertions(+), 58 deletions(-) diff --git a/sequelize/sequelize.d.ts b/sequelize/sequelize.d.ts index 74f682e27..46a0ba41a 100644 --- a/sequelize/sequelize.d.ts +++ b/sequelize/sequelize.d.ts @@ -19,12 +19,13 @@ declare module "sequelize" { // // https://github.com/sequelize/sequelize/tree/v3.4.1/lib/associations // - + + /** * The options for the getAssociation mixin of the belongsTo association. * @see BelongsToGetAssociationMixin */ - interface BelongsToGetAssociationMixinOptions extends Transactable { + interface BelongsToGetAssociationMixinOptions { /** * Apply a scope on the related model, or remove its default scope by passing false. */ @@ -61,7 +62,7 @@ declare module "sequelize" { * The options for the setAssociation mixin of the belongsTo association. * @see BelongsToSetAssociationMixin */ - interface BelongsToSetAssociationMixinOptions extends Transactable { + interface BelongsToSetAssociationMixinOptions { /** * Skip saving this after setting the foreign key if false. */ @@ -102,7 +103,7 @@ declare module "sequelize" { * The options for the createAssociation mixin of the belongsTo association. * @see BelongsToCreateAssociationMixin */ - interface BelongsToCreateAssociationMixinOptions extends Transactable { } + interface BelongsToCreateAssociationMixinOptions { } /** * The createAssociation mixin applied to models with belongsTo. @@ -138,7 +139,7 @@ declare module "sequelize" { * The options for the getAssociation mixin of the hasOne association. * @see HasOneGetAssociationMixin */ - interface HasOneGetAssociationMixinOptions extends Transactable { + interface HasOneGetAssociationMixinOptions { /** * Apply a scope on the related model, or remove its default scope by passing false. */ @@ -175,7 +176,7 @@ declare module "sequelize" { * The options for the setAssociation mixin of the hasOne association. * @see HasOneSetAssociationMixin */ - interface HasOneSetAssociationMixinOptions extends Transactable { + interface HasOneSetAssociationMixinOptions { /** * Skip saving this after setting the foreign key if false. */ @@ -216,7 +217,7 @@ declare module "sequelize" { * The options for the createAssociation mixin of the hasOne association. * @see HasOneCreateAssociationMixin */ - interface HasOneCreateAssociationMixinOptions extends Transactable { } + interface HasOneCreateAssociationMixinOptions { } /** * The createAssociation mixin applied to models with hasOne. @@ -252,7 +253,7 @@ declare module "sequelize" { * The options for the getAssociations mixin of the hasMany association. * @see HasManyGetAssociationsMixin */ - interface HasManyGetAssociationsMixinOptions extends Transactable { + interface HasManyGetAssociationsMixinOptions { /** * An optional where clause to limit the associated models. @@ -302,7 +303,7 @@ declare module "sequelize" { * The options for the setAssociations mixin of the hasMany association. * @see HasManySetAssociationsMixin */ - interface HasManySetAssociationsMixinOptions extends Transactable { + interface HasManySetAssociationsMixinOptions { /** * Run validation for the join model. @@ -352,7 +353,7 @@ declare module "sequelize" { * The options for the addAssociations mixin of the hasMany association. * @see HasManyAddAssociationsMixin */ - interface HasManyAddAssociationsMixinOptions extends Transactable { + interface HasManyAddAssociationsMixinOptions { /** * Run validation for the join model. @@ -401,7 +402,7 @@ declare module "sequelize" { * The options for the addAssociation mixin of the hasMany association. * @see HasManyAddAssociationMixin */ - interface HasManyAddAssociationMixinOptions extends Transactable { + interface HasManyAddAssociationMixinOptions { /** * Run validation for the join model. @@ -450,7 +451,7 @@ declare module "sequelize" { * The options for the createAssociation mixin of the hasMany association. * @see HasManyCreateAssociationMixin */ - interface HasManyCreateAssociationMixinOptions extends Transactable { } + interface HasManyCreateAssociationMixinOptions { } /** * The createAssociation mixin applied to models with hasMany. @@ -493,7 +494,7 @@ declare module "sequelize" { * The options for the removeAssociation mixin of the hasMany association. * @see HasManyRemoveAssociationMixin */ - interface HasManyRemoveAssociationMixinOptions extends Transactable { } + interface HasManyRemoveAssociationMixinOptions { } /** * The removeAssociation mixin applied to models with hasMany. @@ -536,7 +537,7 @@ declare module "sequelize" { * The options for the removeAssociations mixin of the hasMany association. * @see HasManyRemoveAssociationsMixin */ - interface HasManyRemoveAssociationsMixinOptions extends Transactable { } + interface HasManyRemoveAssociationsMixinOptions { } /** * The removeAssociations mixin applied to models with hasMany. @@ -579,7 +580,7 @@ declare module "sequelize" { * The options for the hasAssociation mixin of the hasMany association. * @see HasManyHasAssociationMixin */ - interface HasManyHasAssociationMixinOptions extends Transactable { } + interface HasManyHasAssociationMixinOptions { } /** * The hasAssociation mixin applied to models with hasMany. @@ -622,7 +623,7 @@ declare module "sequelize" { * The options for the hasAssociations mixin of the hasMany association. * @see HasManyHasAssociationsMixin */ - interface HasManyHasAssociationsMixinOptions extends Transactable { } + interface HasManyHasAssociationsMixinOptions { } /** * The removeAssociations mixin applied to models with hasMany. @@ -665,7 +666,7 @@ declare module "sequelize" { * The options for the countAssociations mixin of the hasMany association. * @see HasManyCountAssociationsMixin */ - interface HasManyCountAssociationsMixinOptions extends Transactable { + interface HasManyCountAssociationsMixinOptions { /** * An optional where clause to limit the associated models. @@ -715,7 +716,7 @@ declare module "sequelize" { * The options for the getAssociations mixin of the belongsToMany association. * @see BelongsToManyGetAssociationsMixin */ - interface BelongsToManyGetAssociationsMixinOptions extends Transactable { + interface BelongsToManyGetAssociationsMixinOptions { /** * An optional where clause to limit the associated models. @@ -765,7 +766,7 @@ declare module "sequelize" { * The options for the setAssociations mixin of the belongsToMany association. * @see BelongsToManySetAssociationsMixin */ - interface BelongsToManySetAssociationsMixinOptions extends Transactable { + interface BelongsToManySetAssociationsMixinOptions { /** * Run validation for the join model. @@ -815,7 +816,7 @@ declare module "sequelize" { * The options for the addAssociations mixin of the belongsToMany association. * @see BelongsToManyAddAssociationsMixin */ - interface BelongsToManyAddAssociationsMixinOptions extends Transactable { + interface BelongsToManyAddAssociationsMixinOptions { /** * Run validation for the join model. @@ -864,7 +865,7 @@ declare module "sequelize" { * The options for the addAssociation mixin of the belongsToMany association. * @see BelongsToManyAddAssociationMixin */ - interface BelongsToManyAddAssociationMixinOptions extends Transactable { + interface BelongsToManyAddAssociationMixinOptions { /** * Run validation for the join model. @@ -913,7 +914,7 @@ declare module "sequelize" { * The options for the createAssociation mixin of the belongsToMany association. * @see BelongsToManyCreateAssociationMixin */ - interface BelongsToManyCreateAssociationMixinOptions extends Transactable { } + interface BelongsToManyCreateAssociationMixinOptions { } /** * The createAssociation mixin applied to models with belongsToMany. @@ -956,7 +957,7 @@ declare module "sequelize" { * The options for the removeAssociation mixin of the belongsToMany association. * @see BelongsToManyRemoveAssociationMixin */ - interface BelongsToManyRemoveAssociationMixinOptions extends Transactable { } + interface BelongsToManyRemoveAssociationMixinOptions { } /** * The removeAssociation mixin applied to models with belongsToMany. @@ -999,7 +1000,7 @@ declare module "sequelize" { * The options for the removeAssociations mixin of the belongsToMany association. * @see BelongsToManyRemoveAssociationsMixin */ - interface BelongsToManyRemoveAssociationsMixinOptions extends Transactable { } + interface BelongsToManyRemoveAssociationsMixinOptions { } /** * The removeAssociations mixin applied to models with belongsToMany. @@ -1042,7 +1043,7 @@ declare module "sequelize" { * The options for the hasAssociation mixin of the belongsToMany association. * @see BelongsToManyHasAssociationMixin */ - interface BelongsToManyHasAssociationMixinOptions extends Transactable { } + interface BelongsToManyHasAssociationMixinOptions { } /** * The hasAssociation mixin applied to models with belongsToMany. @@ -1085,7 +1086,7 @@ declare module "sequelize" { * The options for the hasAssociations mixin of the belongsToMany association. * @see BelongsToManyHasAssociationsMixin */ - interface BelongsToManyHasAssociationsMixinOptions extends Transactable { } + interface BelongsToManyHasAssociationsMixinOptions { } /** * The removeAssociations mixin applied to models with belongsToMany. @@ -1128,7 +1129,7 @@ declare module "sequelize" { * The options for the countAssociations mixin of the belongsToMany association. * @see BelongsToManyCountAssociationsMixin */ - interface BelongsToManyCountAssociationsMixinOptions extends Transactable { + interface BelongsToManyCountAssociationsMixinOptions { /** * An optional where clause to limit the associated models. @@ -2537,7 +2538,7 @@ declare module "sequelize" { /** * Options used for Instance.increment method */ - interface InstanceIncrementDecrementOptions extends Transactable { + interface InstanceIncrementDecrementOptions { /** * The number to increment by @@ -2551,29 +2552,39 @@ declare module "sequelize" { */ logging? : boolean | Function; + /** + * Transaction to run query under + */ + transaction? : Transaction; + /** * A hash of attributes to describe your search. See above for examples. */ where? : WhereOptions | Array; - + } /** * Options used for Instance.restore method */ - interface InstanceRestoreOptions extends Transactable { + interface InstanceRestoreOptions { /** * A function that gets executed while running the query to log the sql. */ logging? : boolean | Function; - + + /** + * Transaction to run query under + */ + transaction? : Transaction; + } /** * Options used for Instance.destroy method */ - interface InstanceDestroyOptions extends Transactable { + interface InstanceDestroyOptions { /** * If set to true, paranoid models will actually be deleted @@ -2584,7 +2595,12 @@ declare module "sequelize" { * A function that gets executed while running the query to log the sql. */ logging? : boolean | Function; - + + /** + * Transaction to run the query in + */ + transaction? : Transaction; + } /** @@ -2619,7 +2635,7 @@ declare module "sequelize" { /** * Options used for Instance.save method */ - interface InstanceSaveOptions extends Transactable { + interface InstanceSaveOptions { /** * An optional array of strings, representing database columns. If fields is provided, only those columns @@ -2645,7 +2661,12 @@ declare module "sequelize" { * A function that gets executed while running the query to log the sql. */ logging? : boolean | Function; - + + /** + * Transaction to run the query in + */ + transaction? : Transaction; + } /** @@ -3070,7 +3091,7 @@ declare module "sequelize" { * * A hash of options to describe the scope of the search */ - interface FindOptions extends Transactable { + interface FindOptions { /** * A hash of attributes to describe your search. See above for examples. @@ -3117,6 +3138,11 @@ declare module "sequelize" { */ offset?: number; + /** + * Transaction to run query under + */ + transaction? : Transaction; + /** * Lock the selected rows. Possible options are transaction.LOCK.UPDATE and transaction.LOCK.SHARE. * Postgres also supports transaction.LOCK.KEY_SHARE, transaction.LOCK.NO_KEY_UPDATE and specific model @@ -3144,7 +3170,7 @@ declare module "sequelize" { /** * Options for Model.count method */ - interface CountOptions extends Transactable { + interface CountOptions { /** * A hash of search attributes. @@ -3177,7 +3203,8 @@ declare module "sequelize" { * A function that gets executed while running the query to log the sql. */ logging? : boolean | Function; - + + transaction?: Transaction; } /** @@ -3207,7 +3234,7 @@ declare module "sequelize" { /** * Options for Model.create method */ - interface CreateOptions extends BuildOptions, Transactable { + interface CreateOptions extends BuildOptions { /** * If set, only columns matching those in fields will be saved @@ -3219,6 +3246,11 @@ declare module "sequelize" { */ onDuplicate? : string; + /** + * Transaction to run query under + */ + transaction? : Transaction; + /** * A function that gets executed while running the query to log the sql. */ @@ -3227,13 +3259,12 @@ declare module "sequelize" { silent? : boolean; returning? : boolean; - } /** * Options for Model.findOrInitialize method */ - interface FindOrInitializeOptions extends Transactable { + interface FindOrInitializeOptions { /** * A hash of search attributes. @@ -3245,6 +3276,11 @@ declare module "sequelize" { */ defaults? : TAttributes; + /** + * Transaction to run query under + */ + transaction? : Transaction; + /** * A function that gets executed while running the query to log the sql. */ @@ -3277,7 +3313,7 @@ declare module "sequelize" { /** * Options for Model.bulkCreate method */ - interface BulkCreateOptions extends Transactable { + interface BulkCreateOptions { /** * Fields to insert (defaults to all fields) @@ -3314,6 +3350,11 @@ declare module "sequelize" { */ updateOnDuplicate? : Array; + /** + * Transaction to run query under + */ + transaction? : Transaction; + /** * A function that gets executed while running the query to log the sql. */ @@ -3324,7 +3365,12 @@ declare module "sequelize" { /** * The options passed to Model.destroy in addition to truncate */ - interface TruncateOptions extends Transactable { + interface TruncateOptions { + + /** + * Transaction to run query under + */ + transaction? : Transaction; /** * Only used in conjuction with TRUNCATE. Truncates all tables that have foreign-key references to the @@ -3383,7 +3429,7 @@ declare module "sequelize" { /** * Options for Model.restore */ - interface RestoreOptions extends Transactable { + interface RestoreOptions { /** * Filter the restore @@ -3411,12 +3457,17 @@ declare module "sequelize" { */ logging? : boolean | Function; + /** + * Transaction to run query under + */ + transaction? : Transaction; + } /** * Options used for Model.update */ - interface UpdateOptions extends Transactable { + interface UpdateOptions { /** * Options to describe the scope of the search. @@ -3473,6 +3524,11 @@ declare module "sequelize" { */ logging? : boolean | Function; + /** + * Transaction to run query under + */ + transaction? : Transaction; + } /** @@ -4366,7 +4422,7 @@ declare module "sequelize" { * * @see Options */ - interface QueryOptions extends Transactable { + interface QueryOptions { /** * If true, sequelize will not try to format the results of the query, or build an instance of a model from @@ -4374,6 +4430,11 @@ declare module "sequelize" { */ raw?: boolean; + /** + * The transaction that the query should be executed under + */ + transaction?: Transaction; + /** * The type of query you are executing. The query type affects how results are formatted before they are * passed back. The type is a string, but `Sequelize.QueryTypes` is provided as convenience shortcuts. @@ -5777,18 +5838,7 @@ declare module "sequelize" { * A function that gets executed while running the query to log the sql. */ logging?: Function; - } - - /** - * An interface that allows an item to support working under a transaction - * - * @param transaction Transaction The optional transaction to run under - */ - interface Transactable { - /** - * Transaction to run query under - */ - transaction?: Transaction; + } // From 3b74f5ae2ca561aea50be0cf7aec6723fa37c64a Mon Sep 17 00:00:00 2001 From: rhysd Date: Fri, 4 Dec 2015 09:57:43 +0900 Subject: [PATCH 065/134] github-electron: Add missing menu item option 'role' --- github-electron/github-electron-main-tests.ts | 35 ++++++++++++++++++- github-electron/github-electron.d.ts | 4 +++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index bafbaa49f..a60e32611 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -125,7 +125,40 @@ var dockMenu = Menu.buildFromTemplate([ { label: 'Pro' } ] }, - { label: 'New Command...' } + { label: 'New Command...' }, + { + label: 'Edit', + submenu: [ + { + label: 'Undo', + accelerator: 'CmdOrCtrl+Z', + role: 'undo' + }, + { + label: 'Redo', + accelerator: 'Shift+CmdOrCtrl+Z', + role: 'redo' + }, + { + type: 'separator' + }, + { + label: 'Cut', + accelerator: 'CmdOrCtrl+X', + role: 'cut' + }, + { + label: 'Copy', + accelerator: 'CmdOrCtrl+C', + role: 'copy' + }, + { + label: 'Paste', + accelerator: 'CmdOrCtrl+V', + role: 'paste' + }, + ] + }, ]); app.dock.setMenu(dockMenu); diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index d4ab0099f..679cc6700 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -880,6 +880,10 @@ declare module GitHubElectron { * a given menu. */ position?: string; + /** + * Define the action of the menu item, when specified the click property will be ignored + */ + role?: string; } class BrowserWindowProxy { From cb5206a8ac1c9a3ddfd126f5ecea6729b2361452 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Thu, 3 Dec 2015 20:34:58 -0600 Subject: [PATCH 066/134] Add default_type --- mime/mime.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/mime/mime.d.ts b/mime/mime.d.ts index bfaa7a51f..1009f006c 100644 --- a/mime/mime.d.ts +++ b/mime/mime.d.ts @@ -16,4 +16,5 @@ declare module "mime" { } export var charsets: Charsets; + export var default_type: string; } From 37ee1fd3be5abea113a1a04ddfd4f269e642719d Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Fri, 4 Dec 2015 09:31:31 +0100 Subject: [PATCH 067/134] progress --- foundation-sites/foundation-tests.ts | 115 +++++++++---------- foundation-sites/foundation.d.ts | 166 +++++++++++++-------------- foundation-sites/npm-debug.log | 45 ++++++++ 3 files changed, 185 insertions(+), 141 deletions(-) create mode 100644 foundation-sites/npm-debug.log diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts index 54da9fb79..50f88559b 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-tests.ts @@ -10,60 +10,6 @@ $(document).foundation(); $(document).foundation('method'); $(document).foundation(['method', 'method2']); - - Foundation.Abide.($('.selector')); - Foundation.Abide.($('.selector'), {}); -/* - Foundation.Accordion.($('.selector')); - Foundation.Accordion.($('.selector'), {}); - - Foundation.AccordionMenu.($('.selector')); - Foundation.AccordionMenu.($('.selector'), {}); - - Foundation.DrillDown.($('.selector')); - Foundation.DrillDown.($('.selector'), {}); - - Foundation.Dropdown.($('.selector')); - Foundation.Dropdown.($('.selector'), {}); - - Foundation.DropdownMenu.($('.selector')); - Foundation.DropdownMenu.($('.selector'), {}); - - Foundation.Equalizer.($('.selector')); - Foundation.Equalizer.($('.selector'), {}); - - Foundation.Interchange.($('.selector')); - Foundation.Interchange.($('.selector'), {}); - - Foundation.Magellan.($('.selector')); - Foundation.Magellan.($('.selector'), {}); - - Foundation.OffCanvas.($('.selector')); - Foundation.OffCanvas.($('.selector'), {}); - - Foundation.Orbit.($('.selector')); - Foundation.Orbit.($('.selector'), {}); - - Foundation.Reveal.($('.selector')); - Foundation.Reveal.($('.selector'), {}); - - Foundation.Slider.($('.selector')); - Foundation.Slider.($('.selector'), {}); - - Foundation.Sticky.($('.selector')); - Foundation.Sticky.($('.selector'), {}); - - Foundation.Tabs.($('.selector')); - Foundation.Tabs.($('.selector'), {}); - - Foundation.Toggler.($('.selector')); - Foundation.Toggler.($('.selector'), {}); - - Foundation.Tooltip.($('.selector')); - Foundation.Tooltip.($('.selector'), {}); - */ - -/* function pluginList() { 'use strict'; @@ -89,9 +35,62 @@ function pluginList() { ]; } -pluginList().forEach((value:String) => { - Foundation[value].($('.selector')); - Foundation[value].($('.selector'), {}); +pluginList().forEach((value:string) => { + Foundation[value]($('.selector')); + Foundation[value]($('.selector'), {}); }); -*/ +/* + Foundation.Abide($('.selector')); + Foundation.Abide($('.selector'), {}); + + Foundation.Accordion($('.selector')); + Foundation.Accordion($('.selector'), {}); + + Foundation.AccordionMenu($('.selector')); + Foundation.AccordionMenu($('.selector'), {}); + + Foundation.DrillDown($('.selector')); + Foundation.DrillDown($('.selector'), {}); + + Foundation.Dropdown($('.selector')); + Foundation.Dropdown($('.selector'), {}); + + Foundation.DropdownMenu($('.selector')); + Foundation.DropdownMenu($('.selector'), {}); + + Foundation.Equalizer($('.selector')); + Foundation.Equalizer($('.selector'), {}); + + Foundation.Interchange($('.selector')); + Foundation.Interchange($('.selector'), {}); + + Foundation.Magellan($('.selector')); + Foundation.Magellan($('.selector'), {}); + + Foundation.OffCanvas($('.selector')); + Foundation.OffCanvas($('.selector'), {}); + + Foundation.Orbit($('.selector')); + Foundation.Orbit($('.selector'), {}); + + Foundation.Reveal($('.selector')); + Foundation.Reveal($('.selector'), {}); + + Foundation.Slider($('.selector')); + Foundation.Slider($('.selector'), {}); + + Foundation.Sticky($('.selector')); + Foundation.Sticky($('.selector'), {}); + + Foundation.Tabs($('.selector')); + Foundation.Tabs($('.selector'), {}); + + Foundation.Toggler($('.selector')); + Foundation.Toggler($('.selector'), {}); + + Foundation.Tooltip($('.selector')); + Foundation.Tooltip($('.selector'), {}); + */ + + diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts index 3ec7f344e..dbdb56446 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation.d.ts @@ -5,7 +5,7 @@ /// -declare module Foundation { +declare module FoundationSites { // http://foundation.zurb.com/sites/docs/abide.html#javascript-reference interface Abide { @@ -16,7 +16,7 @@ declare module Foundation { validateInput(element:Object, form:Object): void; validateForm(element:Object): void; validateText(element:Object): boolean; - validateRadio(group:String): boolean; + validateRadio(group:string): boolean; resetForm($form:Object): void; } @@ -42,7 +42,7 @@ declare module Foundation { interface IAbideOptions { slideSpeed?: number; multiOpen?: boolean; - patters?: Foundation.IAbidePatterns; + patters?: IAbidePatterns; } // http://foundation.zurb.com/sites/docs/accordion.html#javascript-reference @@ -80,14 +80,14 @@ declare module Foundation { } interface IDrilldownOptions { - backButton?: String; - wrapper?: String + backButton?: string; + wrapper?: string closeOnClick?: boolean } // http://foundation.zurb.com/sites/docs/dropdown.html#javascript-reference interface Dropdown { - getPositionClass(): String; + getPositionClass(): string; open(): void; close(): void; toggle(): void; @@ -99,7 +99,7 @@ declare module Foundation { hover?: boolean; vOffset?: number; hOffset?: number; - positionClass?: String; + positionClass?: string; trapFocus?: boolean; autoFocus?: boolean; } @@ -115,9 +115,9 @@ declare module Foundation { hoverDelay?: number; clickOpen?: boolean; closingTime?: number; - alignments?: String; - verticalClasss?: String; - rightClasss?: String; + alignments?: string; + verticalClasss?: string; + rightClasss?: string; } // http://foundation.zurb.com/sites/docs/equalizer.html#javascript-reference @@ -134,7 +134,7 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/interchange.html#javascript-reference interface Interchange { - replace(path:String): void; + replace(path:string): void; destroy(): void; } @@ -151,9 +151,9 @@ declare module Foundation { interface IMagellanOptions { animationDuration?: number; - animationEasing?: String; + animationEasing?: string; threshold?: number; - activeClass?: String; + activeClass?: string; deepLinking?: boolean; } @@ -168,12 +168,12 @@ declare module Foundation { interface IOffCanvasOptions { closeOnClick?: boolean; transitionTime?: number; - position?: String; + position?: string; forceTop?: boolean; isRevealed?: boolean; - revealOn?: String; + revealOn?: string; autoFocus?: boolean; - revealClass?: String; + revealClass?: string; } // http://foundation.zurb.com/sites/docs/orbit.html#javascript-reference @@ -186,21 +186,21 @@ declare module Foundation { interface IOrbitOptions { bullets?: boolean; navButtons?: boolean; - animInFromRight?: String; - animOutToRight?: String; - animInFromLeft?: String; - animOutToLeft?: String; + animInFromRight?: string; + animOutToRight?: string; + animInFromLeft?: string; + animOutToLeft?: string; autoPlay?: boolean; timerDelay?: number; infiniteWrap?: boolean; swipe?: boolean; pauseOnHover?: boolean; accessible?: boolean; - containerClass?: String; - slideClass?: String; - boxOfBullets?: String; - nextClass?: String; - prevClass?: String; + containerClass?: string; + slideClass?: string; + boxOfBullets?: string; + nextClass?: string; + prevClass?: string; } // http://foundation.zurb.com/sites/docs/reveal.html#javascript-reference @@ -212,8 +212,8 @@ declare module Foundation { } interface IRevealOptions { - animationIn?: String; - animationOut?: String; + animationIn?: string; + animationOut?: string; showDelay?: number; hideDelay?: number; closeOnClick?: boolean; @@ -246,28 +246,28 @@ declare module Foundation { doubleSided?: boolean; decimal?: number; moveTime?: number; - disabledClass?: String; + disabledClass?: string; } // http://foundation.zurb.com/sites/docs/sticky.html#javascript-reference interface Sticky { - _pauseListeners(scrollListener:String): void; + _pauseListeners(scrollListener:string): void; _calc(checkSizes:boolean, scroll:number): void; destroy(): void; emCalc(number:any): void; } interface IStickyOptions { - container?: String; - stickTo?: String; - anchor?: String; - topAnchor?: String; - btmAnchor?: String; + container?: string; + stickTo?: string; + anchor?: string; + topAnchor?: string; + btmAnchor?: string; marginTop?: number; marginBottom?: number; - stickyOn?: String; - stickyClass?: String; - containerClass?: String; + stickyOn?: string; + stickyClass?: string; + containerClass?: string; checkEvery?: number; } @@ -305,14 +305,14 @@ declare module Foundation { fadeInDuration?: number; fadeOutDuration?: number; disableHover?: boolean; - templateClasses?: String; - tooltipClass?: String; - triggerClass?: String; - showOn?: String; - template?: String; - tipText?: String; + templateClasses?: string; + tooltipClass?: string; + triggerClass?: string; + showOn?: string; + template?: string; + tipText?: string; clickOpen?: boolean; - positionClass?: String; + positionClass?: string; vOffset?: number; hOffset?:number; } @@ -323,17 +323,17 @@ declare module Foundation { interface Box { ImNotTouchingYou(element:Object, parent?:Object, lrOnly?:boolean, tbOnly?:boolean): boolean; GetDimensions(element:Object): Object; - GetOffsets(element:Object, anchor:Object, position:String, vOffset:number, hOffset:number, isOverflow:boolean): Object; + GetOffsets(element:Object, anchor:Object, position:string, vOffset:number, hOffset:number, isOverflow:boolean): Object; } interface KeyBoard { - parseKey(event:any): String; + parseKey(event:any): string; findFocusable($element:Object): Object; } interface MediaQuery { - get(size:String): String; - atLeast(size:String): boolean; + get(size:string): string; + atLeast(size:string): boolean; queries:Array; current:any; } @@ -367,61 +367,61 @@ declare module Foundation { // TODO :extension on jQuery } - interface FoundationStatic { - version : String; + interface FoundationSitesStatic { + version : string; rtl(): boolean; - plugin(plugin:Object, name:String): void; + plugin(plugin:Object, name:string): void; registerPlugin(plugin:Object): void; unregisterPlugin(plugin:Object): void; - GetYoDigits(length:number, namespace?:String): String; - reflow(elem:Object, plugins?:Array|String): void; - getFnName(fn:String): String; - transitionend(): String; + GetYoDigits(length:number, namespace?:string): string; + reflow(elem:Object, plugins?:Array|string): void; + getFnName(fn:string): string; + transitionend(): string; util : { throttle(func:(...args:any[]) => any, delay:number): (...args:any[]) => any; }; onImagesLoaded(images:Object, cb:Function): void; - Abide(element:Object, options?:IAbideOptions): Foundation.Abide; - Accordion(element:Object, options?:IAccordionOptions): Foundation.Accordion; - AccordionMenu(element:Object, options?:IAccordionMenuOptions): Foundation.AccordionMenu; - DrillDown(element:Object, options?:IDrilldownOptions): Foundation.Drilldown; - Dropdown(element:Object, options?:IDropdownOptions): Foundation.Dropdown; - DropdownMenu(element:Object, options?:IDropdownMenuOptions): Foundation.DropdownMenu; - Equalizer(element:Object, options?:IEqualizerOptions): Foundation.Equalizer; - Interchange(element:Object, options?:IInterchangeOptions): Foundation.Interchange; - Magellan(element:Object, options?:IMagellanOptions): Foundation.Magellan; - OffCanvas(element:Object, options?:IOffCanvasOptions): Foundation.OffCanvas; - Orbit(element:Object, options?:IOrbitOptions): Foundation.Orbit; - Reveal(element:Object, options?:IRevealOptions): Foundation.Reveal; - Slider(element:Object, options?:ISliderOptions): Foundation.Slider; - Sticky(element:Object, options?:IStickyOptions): Foundation.Sticky; - Tabs(element:Object, options?:ITabsOptions): Foundation.Tabs; - Toggler(element:Object, options?:ITogglerOptions): Foundation.Toggler; - Tooltip(element:Object, options?:ITooltipOptions): Foundation.Tooltip; + Abide(element:Object, options?:IAbideOptions): Abide; + Accordion(element:Object, options?:IAccordionOptions): Accordion; + AccordionMenu(element:Object, options?:IAccordionMenuOptions): AccordionMenu; + DrillDown(element:Object, options?:IDrilldownOptions): Drilldown; + Dropdown(element:Object, options?:IDropdownOptions): Dropdown; + DropdownMenu(element:Object, options?:IDropdownMenuOptions): DropdownMenu; + Equalizer(element:Object, options?:IEqualizerOptions): Equalizer; + Interchange(element:Object, options?:IInterchangeOptions): Interchange; + Magellan(element:Object, options?:IMagellanOptions): Magellan; + OffCanvas(element:Object, options?:IOffCanvasOptions): OffCanvas; + Orbit(element:Object, options?:IOrbitOptions): Orbit; + Reveal(element:Object, options?:IRevealOptions): Reveal; + Slider(element:Object, options?:ISliderOptions): Slider; + Sticky(element:Object, options?:IStickyOptions): Sticky; + Tabs(element:Object, options?:ITabsOptions): Tabs; + Toggler(element:Object, options?:ITogglerOptions): Toggler; + Tooltip(element:Object, options?:ITooltipOptions): Tooltip; // utils - Box: Foundation.Box; - KeyBoard: Foundation.KeyBoard; - MediaQuery: Foundation.MediaQuery; - Motion: Foundation.Motion; - Move: Foundation.Move; - Nest: Foundation.Nest; - Timer: Foundation.Timer; - Touch: Foundation.Touch; - Triggers: Foundation.Triggers; + Box: Box; + KeyBoard: KeyBoard; + MediaQuery: MediaQuery; + Motion: Motion; + Move: Move; + Nest: Nest; + Timer: Timer; + Touch: Touch; + Triggers: Triggers; } } interface JQuery { - foundation(method?:String|Array) : JQuery; + foundation(method?:string|Array) : JQuery; } -declare var Foundation:Foundation.FoundationStatic; +declare var Foundation:FoundationSites.FoundationSitesStatic; declare module "Foundation" { export = Foundation; diff --git a/foundation-sites/npm-debug.log b/foundation-sites/npm-debug.log new file mode 100644 index 000000000..5a8786ce4 --- /dev/null +++ b/foundation-sites/npm-debug.log @@ -0,0 +1,45 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/Cellar/node/4.2.1/bin/node', +1 verbose cli '/usr/local/bin/npm', +1 verbose cli 'run', +1 verbose cli 'test' ] +2 info using npm@3.3.9 +3 info using node@v4.2.1 +4 verbose run-script [ 'pretest', 'test', 'posttest' ] +5 info lifecycle DefinitelyTyped@0.0.1~pretest: DefinitelyTyped@0.0.1 +6 silly lifecycle DefinitelyTyped@0.0.1~pretest: no script for pretest, continuing +7 info lifecycle DefinitelyTyped@0.0.1~test: DefinitelyTyped@0.0.1 +8 verbose lifecycle DefinitelyTyped@0.0.1~test: unsafe-perm in lifecycle true +9 verbose lifecycle DefinitelyTyped@0.0.1~test: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Volumes/Data/Kwerri/playground/DefinitelyTyped/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin +10 verbose lifecycle DefinitelyTyped@0.0.1~test: CWD: /Volumes/Data/Kwerri/playground/DefinitelyTyped +11 silly lifecycle DefinitelyTyped@0.0.1~test: Args: [ '-c', 'dt --changes' ] +12 silly lifecycle DefinitelyTyped@0.0.1~test: Returned: code: 1 signal: null +13 info lifecycle DefinitelyTyped@0.0.1~test: Failed to exec test script +14 verbose stack Error: DefinitelyTyped@0.0.1 test: `dt --changes` +14 verbose stack Exit status 1 +14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:233:16) +14 verbose stack at emitTwo (events.js:87:13) +14 verbose stack at EventEmitter.emit (events.js:172:7) +14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) +14 verbose stack at emitTwo (events.js:87:13) +14 verbose stack at ChildProcess.emit (events.js:172:7) +14 verbose stack at maybeClose (internal/child_process.js:818:16) +14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) +15 verbose pkgid DefinitelyTyped@0.0.1 +16 verbose cwd /Volumes/Data/Kwerri/playground/DefinitelyTyped/foundation-sites +17 error Darwin 15.0.0 +18 error argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "run" "test" +19 error node v4.2.1 +20 error npm v3.3.9 +21 error code ELIFECYCLE +22 error DefinitelyTyped@0.0.1 test: `dt --changes` +22 error Exit status 1 +23 error Failed at the DefinitelyTyped@0.0.1 test script 'dt --changes'. +23 error This is most likely a problem with the DefinitelyTyped package, +23 error not with npm itself. +23 error Tell the author that this fails on your system: +23 error dt --changes +23 error You can get their info via: +23 error npm owner ls DefinitelyTyped +23 error There is likely additional logging output above. +24 verbose exit [ 1, true ] From 60205dabae191b1fd68fb7830103a6ec7a83a342 Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Fri, 4 Dec 2015 10:10:36 +0100 Subject: [PATCH 068/134] update to tests --- foundation-sites/foundation-tests.ts | 149 ++++++++++++++------------- foundation-sites/foundation.d.ts | 2 +- foundation-sites/npm-debug.log | 45 -------- 3 files changed, 77 insertions(+), 119 deletions(-) delete mode 100644 foundation-sites/npm-debug.log diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts index 50f88559b..225f3c0fa 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-tests.ts @@ -7,90 +7,93 @@ /// $(document).foundation(); -$(document).foundation('method'); +$(document).foundation('method5'); $(document).foundation(['method', 'method2']); -function pluginList() { +Foundation.Abide($('.selector')); +Foundation.Abide($('.selector'), {}); - 'use strict'; +Foundation.Accordion($('.selector')); +Foundation.Accordion($('.selector'), {}); - return [ - 'Abide', - 'Accordion', - 'AccordionMenu', - 'DrillDown', - 'Dropdown', - 'DropdownMenu', - 'Equalizer', - 'Interchange', - 'Magellan', - 'OffCanvas', - 'Orbit', - 'Reveal', - 'Slider', - 'Sticky', - 'Tabs', - 'Toggler', - 'Tooltip' - ]; -} +Foundation.AccordionMenu($('.selector')); +Foundation.AccordionMenu($('.selector'), {}); -pluginList().forEach((value:string) => { - Foundation[value]($('.selector')); - Foundation[value]($('.selector'), {}); -}); +Foundation.DrillDown($('.selector')); +Foundation.DrillDown($('.selector'), {}); + +Foundation.Dropdown($('.selector')); +Foundation.Dropdown($('.selector'), {}); + +Foundation.DropdownMenu($('.selector')); +Foundation.DropdownMenu($('.selector'), {}); + +Foundation.Equalizer($('.selector')); +Foundation.Equalizer($('.selector'), {}); + +Foundation.Interchange($('.selector')); +Foundation.Interchange($('.selector'), {}); + +Foundation.Magellan($('.selector')); +Foundation.Magellan($('.selector'), {}); + +Foundation.OffCanvas($('.selector')); +Foundation.OffCanvas($('.selector'), {}); + +Foundation.Orbit($('.selector')); +Foundation.Orbit($('.selector'), {}); + +Foundation.Reveal($('.selector')); +Foundation.Reveal($('.selector'), {}); + +Foundation.Slider($('.selector')); +Foundation.Slider($('.selector'), {}); + +Foundation.Sticky($('.selector')); +Foundation.Sticky($('.selector'), {}); + +Foundation.Tabs($('.selector')); +Foundation.Tabs($('.selector'), {}); + +Foundation.Toggler($('.selector')); +Foundation.Toggler($('.selector'), {}); + +Foundation.Tooltip($('.selector')); +Foundation.Tooltip($('.selector'), {}); /* - Foundation.Abide($('.selector')); - Foundation.Abide($('.selector'), {}); + TODO: fix this: + error TS7017: Index signature of object type implicitly has an 'any' type. - Foundation.Accordion($('.selector')); - Foundation.Accordion($('.selector'), {}); + function pluginList() { - Foundation.AccordionMenu($('.selector')); - Foundation.AccordionMenu($('.selector'), {}); + 'use strict'; - Foundation.DrillDown($('.selector')); - Foundation.DrillDown($('.selector'), {}); + return [ + 'Abide', + 'Accordion', + 'AccordionMenu', + 'DrillDown', + 'Dropdown', + 'DropdownMenu', + 'Equalizer', + 'Interchange', + 'Magellan', + 'OffCanvas', + 'Orbit', + 'Reveal', + 'Slider', + 'Sticky', + 'Tabs', + 'Toggler', + 'Tooltip' + ]; + } - Foundation.Dropdown($('.selector')); - Foundation.Dropdown($('.selector'), {}); - - Foundation.DropdownMenu($('.selector')); - Foundation.DropdownMenu($('.selector'), {}); - - Foundation.Equalizer($('.selector')); - Foundation.Equalizer($('.selector'), {}); - - Foundation.Interchange($('.selector')); - Foundation.Interchange($('.selector'), {}); - - Foundation.Magellan($('.selector')); - Foundation.Magellan($('.selector'), {}); - - Foundation.OffCanvas($('.selector')); - Foundation.OffCanvas($('.selector'), {}); - - Foundation.Orbit($('.selector')); - Foundation.Orbit($('.selector'), {}); - - Foundation.Reveal($('.selector')); - Foundation.Reveal($('.selector'), {}); - - Foundation.Slider($('.selector')); - Foundation.Slider($('.selector'), {}); - - Foundation.Sticky($('.selector')); - Foundation.Sticky($('.selector'), {}); - - Foundation.Tabs($('.selector')); - Foundation.Tabs($('.selector'), {}); - - Foundation.Toggler($('.selector')); - Foundation.Toggler($('.selector'), {}); - - Foundation.Tooltip($('.selector')); - Foundation.Tooltip($('.selector'), {}); + pluginList().forEach((value:string) => { + Foundation[value]($('.selector')); + Foundation[value]($('.selector'), {}); + }); */ diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts index dbdb56446..a6dd7682d 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation.d.ts @@ -9,7 +9,7 @@ declare module FoundationSites { // http://foundation.zurb.com/sites/docs/abide.html#javascript-reference interface Abide { - requiredCheck(element:Object): boolean; + requiredChedck(element:Object): boolean; findLabel(element:Object): boolean; addErrorClasses(element:Object): void; removeErrorClasses(element:Object): void; diff --git a/foundation-sites/npm-debug.log b/foundation-sites/npm-debug.log deleted file mode 100644 index 5a8786ce4..000000000 --- a/foundation-sites/npm-debug.log +++ /dev/null @@ -1,45 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/local/Cellar/node/4.2.1/bin/node', -1 verbose cli '/usr/local/bin/npm', -1 verbose cli 'run', -1 verbose cli 'test' ] -2 info using npm@3.3.9 -3 info using node@v4.2.1 -4 verbose run-script [ 'pretest', 'test', 'posttest' ] -5 info lifecycle DefinitelyTyped@0.0.1~pretest: DefinitelyTyped@0.0.1 -6 silly lifecycle DefinitelyTyped@0.0.1~pretest: no script for pretest, continuing -7 info lifecycle DefinitelyTyped@0.0.1~test: DefinitelyTyped@0.0.1 -8 verbose lifecycle DefinitelyTyped@0.0.1~test: unsafe-perm in lifecycle true -9 verbose lifecycle DefinitelyTyped@0.0.1~test: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Volumes/Data/Kwerri/playground/DefinitelyTyped/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin -10 verbose lifecycle DefinitelyTyped@0.0.1~test: CWD: /Volumes/Data/Kwerri/playground/DefinitelyTyped -11 silly lifecycle DefinitelyTyped@0.0.1~test: Args: [ '-c', 'dt --changes' ] -12 silly lifecycle DefinitelyTyped@0.0.1~test: Returned: code: 1 signal: null -13 info lifecycle DefinitelyTyped@0.0.1~test: Failed to exec test script -14 verbose stack Error: DefinitelyTyped@0.0.1 test: `dt --changes` -14 verbose stack Exit status 1 -14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:233:16) -14 verbose stack at emitTwo (events.js:87:13) -14 verbose stack at EventEmitter.emit (events.js:172:7) -14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) -14 verbose stack at emitTwo (events.js:87:13) -14 verbose stack at ChildProcess.emit (events.js:172:7) -14 verbose stack at maybeClose (internal/child_process.js:818:16) -14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) -15 verbose pkgid DefinitelyTyped@0.0.1 -16 verbose cwd /Volumes/Data/Kwerri/playground/DefinitelyTyped/foundation-sites -17 error Darwin 15.0.0 -18 error argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "run" "test" -19 error node v4.2.1 -20 error npm v3.3.9 -21 error code ELIFECYCLE -22 error DefinitelyTyped@0.0.1 test: `dt --changes` -22 error Exit status 1 -23 error Failed at the DefinitelyTyped@0.0.1 test script 'dt --changes'. -23 error This is most likely a problem with the DefinitelyTyped package, -23 error not with npm itself. -23 error Tell the author that this fails on your system: -23 error dt --changes -23 error You can get their info via: -23 error npm owner ls DefinitelyTyped -23 error There is likely additional logging output above. -24 verbose exit [ 1, true ] From f7874b963eb324a9ac52caf9dda620c515de936a Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Fri, 4 Dec 2015 10:13:00 +0100 Subject: [PATCH 069/134] removed debug log --- npm-debug.log | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 npm-debug.log diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index 19dc7e7fd..000000000 --- a/npm-debug.log +++ /dev/null @@ -1,45 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/local/Cellar/node/4.2.1/bin/node', -1 verbose cli '/usr/local/bin/npm', -1 verbose cli 'run', -1 verbose cli 'test' ] -2 info using npm@3.3.9 -3 info using node@v4.2.1 -4 verbose run-script [ 'pretest', 'test', 'posttest' ] -5 info lifecycle DefinitelyTyped@0.0.1~pretest: DefinitelyTyped@0.0.1 -6 silly lifecycle DefinitelyTyped@0.0.1~pretest: no script for pretest, continuing -7 info lifecycle DefinitelyTyped@0.0.1~test: DefinitelyTyped@0.0.1 -8 verbose lifecycle DefinitelyTyped@0.0.1~test: unsafe-perm in lifecycle true -9 verbose lifecycle DefinitelyTyped@0.0.1~test: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Volumes/Data/Kwerri/playground/DefinitelyTyped/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin -10 verbose lifecycle DefinitelyTyped@0.0.1~test: CWD: /Volumes/Data/Kwerri/playground/DefinitelyTyped -11 silly lifecycle DefinitelyTyped@0.0.1~test: Args: [ '-c', 'dt --changes' ] -12 silly lifecycle DefinitelyTyped@0.0.1~test: Returned: code: 1 signal: null -13 info lifecycle DefinitelyTyped@0.0.1~test: Failed to exec test script -14 verbose stack Error: DefinitelyTyped@0.0.1 test: `dt --changes` -14 verbose stack Exit status 1 -14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:233:16) -14 verbose stack at emitTwo (events.js:87:13) -14 verbose stack at EventEmitter.emit (events.js:172:7) -14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) -14 verbose stack at emitTwo (events.js:87:13) -14 verbose stack at ChildProcess.emit (events.js:172:7) -14 verbose stack at maybeClose (internal/child_process.js:818:16) -14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) -15 verbose pkgid DefinitelyTyped@0.0.1 -16 verbose cwd /Volumes/Data/Kwerri/playground/DefinitelyTyped -17 error Darwin 15.0.0 -18 error argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "run" "test" -19 error node v4.2.1 -20 error npm v3.3.9 -21 error code ELIFECYCLE -22 error DefinitelyTyped@0.0.1 test: `dt --changes` -22 error Exit status 1 -23 error Failed at the DefinitelyTyped@0.0.1 test script 'dt --changes'. -23 error This is most likely a problem with the DefinitelyTyped package, -23 error not with npm itself. -23 error Tell the author that this fails on your system: -23 error dt --changes -23 error You can get their info via: -23 error npm owner ls DefinitelyTyped -23 error There is likely additional logging output above. -24 verbose exit [ 1, true ] From 380e701b39abbd48a435971bb7560974ad43b33e Mon Sep 17 00:00:00 2001 From: Valentyn Shybanov Date: Fri, 4 Dec 2015 13:31:52 +0100 Subject: [PATCH 070/134] Added missing updateParams method According to documentation, `updateParams` method existed even in 1.3 but it was missing in `IRouteService`. Added this missing method. --- angularjs/angular-route.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index 662b2c11d..63bc75594 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -35,6 +35,16 @@ declare module angular.route { // May not always be available. For instance, current will not be available // to a controller that was not initialized as a result of a route maching. current?: ICurrentRoute; + + /** + * Causes $route service to update the current URL, replacing current route parameters with those specified in newParams. + * Provided property names that match the route's path segment definitions will be interpolated into the + * location's path, while remaining properties will be treated as query params. + * + * @param newParams Object. mapping of URL parameter names to values + */ + updateParams(newParams:{[key:string]:string}); + } From 7610dacad225bc62f0965b8e8af18eaecd69fda0 Mon Sep 17 00:00:00 2001 From: Valentyn Shybanov Date: Fri, 4 Dec 2015 13:36:19 +0100 Subject: [PATCH 071/134] Added return type of updateParams Added required return type of updateParams --- angularjs/angular-route.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index 63bc75594..5f426d51c 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -43,7 +43,7 @@ declare module angular.route { * * @param newParams Object. mapping of URL parameter names to values */ - updateParams(newParams:{[key:string]:string}); + updateParams(newParams:{[key:string]:string}): void; } From 320f9c0475d523016d8e3a10fa8705e229185897 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Fri, 4 Dec 2015 23:37:10 +0500 Subject: [PATCH 072/134] lodash: signatures of _.flow have been changed --- lodash/lodash-tests.ts | 32 ++++++++++++++++++++++++++++---- lodash/lodash.d.ts | 10 +++++++++- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 9cae2a872..9750fbd5e 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -4822,10 +4822,34 @@ module TestDelay { } // _.flow -var testFlowSquareFn = (n: number) => n * n; -var testFlowAddFn = (n: number, m: number) => n + m; -result = _.flow<(n: number, m: number) => number>(testFlowAddFn, testFlowSquareFn)(1, 2); -result = _(testFlowAddFn).flow<(n: number, m: number) => number>(testFlowSquareFn).value()(1, 2); +module TestFlow { + let Fn1: (n: number) => number; + let Fn2: (m: number, n: number) => number; + + { + let result: (m: number, n: number) => number; + + result = _.flow<(m: number, n: number) => number>(Fn1, Fn2); + result = _.flow<(m: number, n: number) => number>(Fn1, Fn1, Fn2); + result = _.flow<(m: number, n: number) => number>(Fn1, Fn1, Fn1, Fn2); + } + + { + let result: _.LoDashImplicitObjectWrapper<(m: number, n: number) => number>; + + result = _(Fn1).flow<(m: number, n: number) => number>(Fn2); + result = _(Fn1).flow<(m: number, n: number) => number>(Fn1, Fn2); + result = _(Fn1).flow<(m: number, n: number) => number>(Fn1, Fn1, Fn2); + } + + { + let result: _.LoDashExplicitObjectWrapper<(m: number, n: number) => number>; + + result = _(Fn1).chain().flow<(m: number, n: number) => number>(Fn2); + result = _(Fn1).chain().flow<(m: number, n: number) => number>(Fn1, Fn2); + result = _(Fn1).chain().flow<(m: number, n: number) => number>(Fn1, Fn1, Fn2); + } +} // _.flowRight module TestFlowRight { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index ed8d72443..3aaf4a68b 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -8340,6 +8340,7 @@ declare module _ { /** * Creates a function that returns the result of invoking the provided functions with the this binding of the * created function, where each successive invocation is supplied the return value of the previous. + * * @param funcs Functions to invoke. * @return Returns the new function. */ @@ -8349,10 +8350,17 @@ declare module _ { interface LoDashImplicitObjectWrapper { /** * @see _.flow - **/ + */ flow(...funcs: Function[]): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.flow + */ + flow(...funcs: Function[]): LoDashExplicitObjectWrapper; + } + //_.flowRight interface LoDashStatic { /** From b545524610b8dffbe787b8d7e001ee2bcfa6b69f Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 4 Dec 2015 14:04:52 -0500 Subject: [PATCH 073/134] RequestPromise to extend Promise The current then/catch/finally in RequestPromise don't have proper definition. As a result `await` in Typescript 1.7 fails during compilation blaming that there's no proper `then` implementation. --- request-promise/request-promise.d.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/request-promise/request-promise.d.ts b/request-promise/request-promise.d.ts index d442e527f..b35856277 100644 --- a/request-promise/request-promise.d.ts +++ b/request-promise/request-promise.d.ts @@ -12,10 +12,7 @@ declare module 'request-promise' { import request = require('request'); import http = require('http'); - interface RequestPromise extends request.Request { - then(onFulfilled: Function, onRejected?: Function): Promise; - catch(onRejected: Function): Promise; - finally(onFinished: Function): Promise; + interface RequestPromise extends request.Request, Promise { promise(): Promise; } From 90d18f6f484c05bf0f80de42bcb25657401393e0 Mon Sep 17 00:00:00 2001 From: Leon Yu Date: Fri, 4 Dec 2015 07:30:48 -0500 Subject: [PATCH 074/134] simple-mock.d.ts Fix bug with uppercase --- simple-mock/simple-mock-tests.ts | 1024 ++++++++++++++++++++++++++++++ simple-mock/simple-mock.d.ts | 194 ++++++ 2 files changed, 1218 insertions(+) create mode 100644 simple-mock/simple-mock-tests.ts create mode 100644 simple-mock/simple-mock.d.ts diff --git a/simple-mock/simple-mock-tests.ts b/simple-mock/simple-mock-tests.ts new file mode 100644 index 000000000..e83b22aff --- /dev/null +++ b/simple-mock/simple-mock-tests.ts @@ -0,0 +1,1024 @@ +/// +/// +/// + +/// + +'use strict' + +import simple = require('simple-mock'); +import assert = require('assert'); + +import Bluebird = require('bluebird'); + +// Following code is a TypeScript convertion of the test suite bundled with simple-mock. +// Original test in MIT license + +describe('simple', function () { + describe('spy()', function () { + describe('for noop function', function () { + let spyFn: Simple.Spy; + + beforeEach(function () { + spyFn = simple.spy(function () {}) + }) + + it('can be queried without having been called', function () { + assert.equal(spyFn.callCount, 0) + assert.deepEqual(spyFn.calls, []) + assert(spyFn.lastCall) + assert.deepEqual(spyFn.lastCall.args, []) + }) + + it('can be queried for arguments on a single call', function () { + let context = { + spyFn: spyFn + } + + context.spyFn('with', 'args') + + assert(spyFn.called) + assert.equal(spyFn.callCount, 1) + assert(spyFn.calls) + assert(spyFn.firstCall) + assert.equal(spyFn.firstCall, spyFn.lastCall) + assert.equal(spyFn.firstCall, spyFn.calls[0]) + assert.deepEqual(spyFn.lastCall.args, ['with', 'args']) + assert.equal(spyFn.lastCall.context, context) + }) + + it('can be queried for arguments over multiple calls', function () { + let context = { + spyFn: spyFn + } + + spyFn('with', 'args') + spyFn('and') + context.spyFn('more', 'args') + + assert(spyFn.called) + assert.equal(spyFn.callCount, 3) + assert(spyFn.calls) + assert(spyFn.firstCall) + assert.equal(spyFn.firstCall, spyFn.calls[0]) + assert.deepEqual(spyFn.firstCall.args, ['with', 'args']) + assert(spyFn.calls[1]) + assert.deepEqual(spyFn.calls[1].args, ['and']) + assert(spyFn.lastCall) + assert.equal(spyFn.lastCall, spyFn.calls[2]) + assert.deepEqual(spyFn.lastCall.args, ['more', 'args']) + assert.equal(spyFn.lastCall.context, context) + }) + }) + + describe('for a throwing function', function () { + let originalFn: () => void; + let spyFn: Simple.Spy; + beforeEach(function () { + let i = 0 + + originalFn = function () { + throw new Error(`${i++}`) + } + + spyFn = simple.spy(originalFn) + }) + + it('can be queried without having been called', function () { + assert(!spyFn.called) + assert.equal(spyFn.callCount, 0) + assert.deepEqual(spyFn.calls, []) + assert(spyFn.lastCall) + assert.equal(spyFn.lastCall.threw, undefined) + }) + + it('can be queried for what it threw on a single call', function () { + let threw: Error; + try { + spyFn() + } catch (e) { + threw = e + } + + assert(threw) + assert(spyFn.called) + assert.equal(spyFn.callCount, 1) + assert(spyFn.firstCall) + assert.equal(spyFn.firstCall.threw, threw) + }) + + it('can be queried for what it threw over multiple calls', function () { + let threw: Error[] = [] + try { + spyFn() + } catch (e) { + threw.push(e) + } + try { + spyFn() + } catch (e) { + threw.push(e) + } + try { + spyFn() + } catch (e) { + threw.push(e) + } + + assert.equal(threw.length, 3) + assert(spyFn.called) + assert.equal(spyFn.callCount, 3) + assert(spyFn.firstCall) + assert.equal(spyFn.firstCall.threw, threw[0]) + assert.equal(spyFn.calls[1].threw, threw[1]) + assert.equal(spyFn.lastCall.threw, threw[2]) + }) + }) + + describe('for a returning function', function () { + let originalFn: () => number; + let spyFn: Simple.Spy; + beforeEach(function () { + let i = 1 + + originalFn = () => { + return i++ + } + + spyFn = simple.spy(originalFn) + }) + + it('can be queried without having been called', function () { + assert(!spyFn.called) + assert.equal(spyFn.callCount, 0) + assert.deepEqual(spyFn.calls, []) + assert(spyFn.lastCall) + assert.equal(spyFn.lastCall.returned, undefined) + }) + + it('can be queried for what it threw on a single call', function () { + let returned: number + + returned = spyFn() + + assert(returned) + assert.equal(spyFn.callCount, 1) + assert(spyFn.firstCall) + assert.equal(spyFn.firstCall.returned, returned) + }) + + it('can be queried for what it threw over multiple calls', function () { + let returned: number[] = [] + + returned.push(spyFn()) + returned.push(spyFn()) + returned.push(spyFn()) + + assert.equal(returned.length, 3) + assert(spyFn.called) + assert.equal(spyFn.callCount, 3) + assert(spyFn.firstCall) + assert.equal(spyFn.firstCall.returned, returned[0]) + assert.equal(spyFn.calls[1].returned, returned[1]) + assert.equal(spyFn.lastCall.returned, returned[2]) + }) + }) + + describe('calls of multiple spies', function () { + it('can be compared to determine the order they were called in', function () { + let spy1 = simple.spy(function () {}) + let spy2 = simple.spy(function () {}) + let spy3 = simple.spy(function () {}) + + spy1() + spy3() + spy2() + spy1() + + assert(spy1.lastCall.k > spy2.lastCall.k) + assert(spy1.lastCall.k > spy3.lastCall.k) + assert(spy2.lastCall.k > spy3.lastCall.k) + assert(spy3.lastCall.k > spy1.calls[0].k) + }) + }) + }) + + describe('stub()', function () { + describe('with no configuration', function () { + let stubFn: Simple.Stub; + it('is also a spy', function () { + stubFn = simple.stub() + + stubFn('etc') + assert(stubFn.called) + assert(stubFn.lastCall.args[0], 'etc') + }) + }) + + describe('for a single callback configuration', function () { + let stubFn: Simple.Stub; + describe('with default index', function () { + beforeEach(function () { + stubFn = simple.stub().callbackWith(1, 2, 3) + }) + + it('can call back with arguments', function () { + stubFn('a', function () { + assert(stubFn.called) + assert.equal(stubFn.callCount, 1) + assert.equal(stubFn.lastCall.args[0], 'a') + assert.equal(arguments.length, 3) + assert.equal(arguments[0], 1) + assert.equal(arguments[1], 2) + assert.equal(arguments[2], 3) + }) + }) + + it('can call back with arguments, over multiple calls', function () { + stubFn('a', function () {}) + stubFn('b', function () { + assert(stubFn.called) + assert.equal(stubFn.callCount, 2) + assert.equal(stubFn.lastCall.args[0], 'b') + assert.equal(arguments.length, 3) + assert.equal(arguments[0], 1) + assert.equal(arguments[1], 2) + assert.equal(arguments[2], 3) + }) + }) + }) + + describe('with specified index', function () { + beforeEach(function () { + stubFn = simple.stub().callbackArgWith(1, 2, 3) + }) + + it('can call back with arguments', function () { + stubFn('a', function () { + assert(stubFn.called) + assert.equal(stubFn.callCount, 1) + assert.equal(stubFn.lastCall.args[0], 'a') + assert.equal(arguments.length, 2) + assert.equal(arguments[0], 2) + assert.equal(arguments[1], 3) + }) + }) + + it('can call back with arguments, over multiple calls', function () { + stubFn('a', function () {}) + stubFn('b', function () { + assert(stubFn.called) + assert.equal(stubFn.callCount, 2) + assert.equal(stubFn.lastCall.args[0], 'b') + assert.equal(arguments.length, 2) + assert.equal(arguments[0], 2) + assert.equal(arguments[1], 3) + }) + }) + }) + + describe('with context specified', function () { + beforeEach(function () { + stubFn = simple.stub().callback().inThisContext({ a: 'a' }) + }) + + it('should do what...', function (done) { + stubFn(function () { + assert.equal(this.a, 'a') + done() + }) + }) + }) + }) + + describe('for a multiple callback configurations', function () { + let stubFn: Simple.Stub; + beforeEach(function () { + stubFn = simple.stub().callbackWith(1).callbackWith(2).callbackWith(3) + }) + + it('can call back once with arguments', function () { + stubFn('a', function () { + assert(stubFn.called) + assert.equal(stubFn.callCount, 1) + assert.equal(stubFn.lastCall.args[0], 'a') + assert.equal(arguments[0], 1) + }) + }) + + it('can call back with arguments, over multiple calls, looping per default', function () { + stubFn('a', function () {}) + stubFn('b', function () { + assert(stubFn.called) + assert.equal(stubFn.callCount, 2) + assert.equal(stubFn.lastCall.args[0], 'b') + assert.equal(arguments[0], 2) + }) + stubFn('c', function () { + assert(stubFn.called) + assert.equal(stubFn.callCount, 3) + assert.equal(stubFn.lastCall.args[0], 'c') + assert.equal(arguments[0], 3) + }) + stubFn('d', function () { + assert.equal(stubFn.callCount, 4) + assert.equal(stubFn.lastCall.args[0], 'd') + assert.equal(arguments[0], 1) + }) + }) + + it('can call back with arguments, over multiple calls, looping turned off', function () { + stubFn.loop = false + stubFn('a', function () {}) + stubFn('b', function () { + assert(stubFn.called) + assert.equal(stubFn.callCount, 2) + assert.equal(stubFn.lastCall.args[0], 'b') + assert.equal(arguments[0], 2) + }) + stubFn('c', function () { + assert(stubFn.called) + assert.equal(stubFn.callCount, 3) + assert.equal(stubFn.lastCall.args[0], 'c') + assert.equal(arguments[0], 3) + }) + let neverCalled = true + stubFn('d', function () { + neverCalled = false + }) + assert(neverCalled) + }) + }) + + describe('for a single throwing configuration', function () { + let stubFn: Simple.Stub; + beforeEach(function () { + stubFn = simple.stub().throwWith(new Error('example')) + }) + + it('can throw', function () { + let threw: Error + try { + stubFn() + } catch (e) { + threw = e + } + + assert(threw) + assert(stubFn.called) + assert.equal(stubFn.callCount, 1) + assert.equal(threw.message, 'example') + }) + + it('can throw over multiple calls, looping per default', function () { + let threw: Error[] = [] + try { + stubFn() + } catch (e) { + threw.push(e) + } + try { + stubFn() + } catch (e) { + threw.push(e) + } + + assert.equal(threw.length, 2) + assert(stubFn.called) + assert.equal(stubFn.callCount, 2) + assert.equal(threw[0], threw[1]) + assert.equal(threw[0].message, 'example') + }) + }) + + describe('for a multiple throwing configurations', function () { + let stubFn: Simple.Stub; + beforeEach(function () { + stubFn = simple.stub().throwWith(new Error('a')).throwWith(new Error('b')) + }) + + it('can throw', function () { + let threw: Error + try { + stubFn() + } catch (e) { + threw = e + } + + assert(threw) + assert(stubFn.called) + assert.equal(stubFn.callCount, 1) + assert.equal(threw.message, 'a') + }) + + it('can throw over multiple calls, looping per default', function () { + let threw: Error[] = [] + try { + stubFn() + } catch (e) { + threw.push(e) + } + try { + stubFn() + } catch (e) { + threw.push(e) + } + try { + stubFn() + } catch (e) { + threw.push(e) + } + + assert.equal(threw.length, 3) + assert(stubFn.called) + assert.equal(stubFn.callCount, 3) + assert.equal(threw[0].message, 'a') + assert.equal(threw[1].message, 'b') + assert.equal(threw[2].message, 'a') + }) + + it('can throw over multiple calls, looping turned off', function () { + stubFn.loop = false + + let threw: Error[] = [] + try { + stubFn() + } catch (e) { + threw.push(e) + } + try { + stubFn() + } catch (e) { + threw.push(e) + } + try { + stubFn() + } catch (e) { + threw.push(e) + } + + assert.equal(threw.length, 2) + assert(stubFn.called) + assert.equal(stubFn.callCount, 3) + assert.equal(threw[0].message, 'a') + assert.equal(threw[1].message, 'b') + }) + }) + + describe('for a single returning configuration', function () { + let stubFn: Simple.Stub; + beforeEach(function () { + stubFn = simple.stub() + }) + + it('can return', function () { + stubFn.returnWith('example') + + let returned: string + returned = stubFn() + + assert(returned) + assert.equal(stubFn.callCount, 1) + assert.equal(returned, 'example') + }) + + it('can return an empty string', function () { + stubFn.returnWith('') + + let returned: string + returned = stubFn() + + assert.equal(stubFn.callCount, 1) + assert.equal(returned, '') + }) + + it('can return over multiple calls, looping per default', function () { + stubFn.returnWith('example-a') + stubFn.returnWith('example-b') + + let returned: string[] = [] + returned.push(stubFn()) + returned.push(stubFn()) + returned.push(stubFn()) + returned.push(stubFn()) + + assert.equal(returned.length, 4) + assert(stubFn.called) + assert.equal(stubFn.callCount, 4) + assert.equal(returned[0], returned[2]) + assert.equal(returned[0], 'example-a') + assert.equal(returned[1], returned[3]) + assert.equal(returned[1], 'example-b') + }) + }) + + describe('for a multiple returning configurations', function () { + let stubFn: Simple.Stub; + beforeEach(function () { + stubFn = simple.stub().returnWith('a').returnWith('b') + }) + + it('can return', function () { + let returned: string + returned = stubFn() + + assert(returned) + assert.equal(stubFn.callCount, 1) + assert.equal(returned, 'a') + }) + + it('can return over multiple calls, looping per default', function () { + let returned: string[] = [] + returned.push(stubFn()) + returned.push(stubFn()) + returned.push(stubFn()) + + assert.equal(returned.length, 3) + assert(stubFn.called) + assert.equal(stubFn.callCount, 3) + assert.equal(returned[0], 'a') + assert.equal(returned[1], 'b') + assert.equal(returned[2], 'a') + }) + + it('can return over multiple calls, looping turned off', function () { + stubFn.loop = false + + let returned: string[] = [] + returned.push(stubFn()) + returned.push(stubFn()) + returned.push(stubFn()) + + assert.equal(returned.length, 3) + assert(stubFn.called) + assert.equal(stubFn.callCount, 3) + assert.equal(returned[0], 'a') + assert.equal(returned[1], 'b') + assert.equal(returned[2], undefined) + }) + }) + + describe('for a specified function to call', function () { + it('should be called with arguments and return', function () { + let stubFn = simple.stub().callFn(function () { + return arguments + }) + + let returned = stubFn('z', 'x') + + assert.equal(stubFn.callCount, 1) + assert.equal(returned[0], 'z') + assert.equal(returned[1], 'x') + }) + + it('should be able to throw', function () { + let stubFn = simple.stub().callFn(function () { + throw new Error('my message') + }) + + try { + stubFn() + } catch(e) { + assert(e instanceof Error) + assert.equal(e.message, 'my message') + } + }) + + it('should be called in context', function () { + let mockObj = { + stubFn: simple.stub().callFn(function () { + return this + }) + } + + let returned = mockObj.stubFn() + + assert.equal(returned, mockObj) + }) + + it('can be called in specified context', function () { + let anotherMockObj = {} + + let mockObj = { + stubFn: simple.stub().callFn(function () { + return this + }).inThisContext(anotherMockObj) + } + + let returned = mockObj.stubFn() + + assert.equal(returned, anotherMockObj) + }) + }) + + describe('for custom/when-conforming promises', function () { + let fulfilledStub: Simple.Stub + let rejectedStub: Simple.Stub + + beforeEach(function () { + fulfilledStub = simple.stub().returnWith(true) + rejectedStub = simple.stub().returnWith(true) + + interface MockPromise { + resolveValue: T, + rejectValue: T, + then(fulfilledFn: (value: any) => T, rejectedFn: (error: any) => T): void; + } + + let mockPromise: MockPromise = { + resolveValue: null as boolean, + rejectValue: null as boolean, + then: function (fulfilledFn: (value: any) => boolean, rejectedFn: (error: any) => boolean) { + let self = this + process.nextTick(function () { + if (self.resolveValue) return fulfilledFn(self.resolveValue) + if (self.rejectValue) return rejectedFn(self.rejectValue) + }) + } + } + + simple.mock(simple, 'Promise', { + when: function(value: T) { + let promise: MockPromise = Object.create(mockPromise) + promise.resolveValue = value + return promise + }, + reject: function(value: T) { + let promise: MockPromise = Object.create(mockPromise) + promise.rejectValue = value + return promise + } + }) + }) + + describe('with a single resolving configuration', function () { + let stubFn: Simple.Stub>; + beforeEach(function () { + stubFn = simple.stub().resolveWith('example') + }) + + it('can return a promise', function (done) { + let returned = stubFn() + + assert(returned) + + returned.then(fulfilledStub, rejectedStub) + + setTimeout(function () { + assert.equal(fulfilledStub.callCount, 1) + assert.equal(fulfilledStub.lastCall.arg, 'example') + assert.equal(rejectedStub.callCount, 0) + done() + }, 0) + }) + }) + + describe('with a multiple resolving configurations', function () { + let stubFn: Simple.Stub>; + beforeEach(function () { + stubFn = simple.stub().resolveWith('a').resolveWith('b') + }) + + it('can return a promise', function (done) { + let returned = stubFn() + + assert(returned) + + returned.then(fulfilledStub, rejectedStub) + + setTimeout(function () { + assert.equal(fulfilledStub.callCount, 1) + assert.equal(fulfilledStub.lastCall.arg, 'a') + assert.equal(rejectedStub.callCount, 0) + done() + }, 0) + }) + + it('can return over multiple calls, looping per default', function (done) { + stubFn().then(fulfilledStub, rejectedStub) + stubFn().then(fulfilledStub, rejectedStub) + stubFn().then(fulfilledStub, rejectedStub) + + setTimeout(function () { + assert.equal(fulfilledStub.callCount, 3) + assert.equal(fulfilledStub.calls[0].arg, 'a') + assert.equal(fulfilledStub.calls[1].arg, 'b') + assert.equal(fulfilledStub.calls[2].arg, 'a') + assert.equal(rejectedStub.callCount, 0) + done() + }, 0) + }) + }) + + describe('with a single rejecting configuration', function () { + let stubFn: Simple.Stub>; + beforeEach(function () { + stubFn = simple.stub().rejectWith('example') + }) + + it('can return a promise', function (done) { + let returned = stubFn() + + assert(returned) + + returned.then(fulfilledStub, rejectedStub) + + setTimeout(function () { + assert.equal(fulfilledStub.callCount, 0) + assert.equal(rejectedStub.callCount, 1) + assert.equal(rejectedStub.lastCall.arg, 'example') + done() + }, 0) + }) + }) + + describe('with a multiple rejecting configurations', function () { + let stubFn: Simple.Stub>; + beforeEach(function () { + stubFn = simple.stub().rejectWith('a').rejectWith('b') + }) + + it('can return a promise', function (done) { + let returned = stubFn() + + assert(returned) + + returned.then(fulfilledStub, rejectedStub) + + setTimeout(function () { + assert.equal(fulfilledStub.callCount, 0) + assert.equal(rejectedStub.callCount, 1) + assert.equal(rejectedStub.lastCall.arg, 'a') + done() + }, 0) + }) + + it('can return over multiple calls, looping per default', function (done) { + stubFn().then(fulfilledStub, rejectedStub) + stubFn().then(fulfilledStub, rejectedStub) + stubFn().then(fulfilledStub, rejectedStub) + + setTimeout(function () { + assert.equal(fulfilledStub.callCount, 0) + assert.equal(rejectedStub.callCount, 3) + assert.equal(rejectedStub.calls[0].arg, 'a') + assert.equal(rejectedStub.calls[1].arg, 'b') + assert.equal(rejectedStub.calls[2].arg, 'a') + done() + }, 0) + }) + }) + }) + + describe('for native/conforming promises', function () { + let fulfilledStub: Simple.Stub + let rejectedStub: Simple.Stub + + beforeEach(function () { + fulfilledStub = simple.stub().returnWith(true) + rejectedStub = simple.stub().returnWith(true) + }) + + describe('with a single resolving configuration', function () { + let stubFn: Simple.Stub>; + beforeEach(function () { + stubFn = simple.stub().resolveWith('example') + }) + + it('can return a promise', function (done) { + let returned = stubFn() + + assert(returned) + + returned.then(fulfilledStub, rejectedStub) + + setTimeout(function () { + assert.equal(fulfilledStub.callCount, 1) + assert.equal(fulfilledStub.lastCall.arg, 'example') + assert.equal(rejectedStub.callCount, 0) + done() + }, 0) + }) + }) + + describe('with a multiple resolving configurations', function () { + let stubFn: Simple.Stub>; + beforeEach(function () { + stubFn = simple.stub().resolveWith('a').resolveWith('b') + }) + + it('can return a promise', function (done) { + let returned = stubFn() + + assert(returned) + + returned.then(fulfilledStub, rejectedStub) + + setTimeout(function () { + assert.equal(fulfilledStub.callCount, 1) + assert.equal(fulfilledStub.lastCall.arg, 'a') + assert.equal(rejectedStub.callCount, 0) + done() + }, 0) + }) + + it('can return over multiple calls, looping per default', function (done) { + stubFn().then(fulfilledStub, rejectedStub) + stubFn().then(fulfilledStub, rejectedStub) + stubFn().then(fulfilledStub, rejectedStub) + + setTimeout(function () { + assert.equal(fulfilledStub.callCount, 3) + assert.equal(fulfilledStub.calls[0].arg, 'a') + assert.equal(fulfilledStub.calls[1].arg, 'b') + assert.equal(fulfilledStub.calls[2].arg, 'a') + assert.equal(rejectedStub.callCount, 0) + done() + }, 0) + }) + }) + + describe('with a single rejecting configuration', function () { + let stubFn: Simple.Stub>; + beforeEach(function () { + stubFn = simple.stub().rejectWith('example') + }) + + it('can return a promise', function (done) { + let returned = stubFn() + + assert(returned) + + returned.then(fulfilledStub, rejectedStub) + + setTimeout(function () { + assert.equal(fulfilledStub.callCount, 0) + assert.equal(rejectedStub.callCount, 1) + assert.equal(rejectedStub.lastCall.arg, 'example') + done() + }, 0) + }) + }) + + describe('with a multiple rejecting configurations', function () { + let stubFn: Simple.Stub>; + beforeEach(function () { + stubFn = simple.stub().rejectWith('a').rejectWith('b') + }) + + it('can return a promise', function (done) { + let returned = stubFn() + + assert(returned) + + returned.then(fulfilledStub, rejectedStub) + + setTimeout(function () { + assert.equal(fulfilledStub.callCount, 0) + assert.equal(rejectedStub.callCount, 1) + assert.equal(rejectedStub.lastCall.arg, 'a') + done() + }, 0) + }) + + it('can return over multiple calls, looping per default', function (done) { + stubFn().then(fulfilledStub, rejectedStub) + stubFn().then(fulfilledStub, rejectedStub) + stubFn().then(fulfilledStub, rejectedStub) + + setTimeout(function () { + assert.equal(fulfilledStub.callCount, 0) + assert.equal(rejectedStub.callCount, 3) + assert.equal(rejectedStub.calls[0].arg, 'a') + assert.equal(rejectedStub.calls[1].arg, 'b') + assert.equal(rejectedStub.calls[2].arg, 'a') + done() + }, 0) + }) + }) + }) + }) + + describe('mock()', function () { + describe('on a object with prototype', function () { + class ProtoKlass { + protoValue: string = 'x' + protoFn() { + return 'x' + } + } + + let obj: any + + before(function () { + }) + + beforeEach(function () { + obj = new ProtoKlass() + }) + + it('can mock instance values over its prototype\'s and restore', function () { + simple.mock(obj, 'protoValue', 'y') + assert.equal(obj.protoValue, 'y') + simple.restore() + assert.equal(obj.protoValue, 'x') + }) + + it('can mock with custom instance functions over its prototype\'s and restore', function () { + simple.mock(obj, 'protoFn', function () { + return 'y' + }) + assert.equal(obj.protoFn(), 'y') + assert(obj.protoFn.called) + simple.restore() + assert.equal(obj.protoFn(), 'x') + }) + + it('can mock with stubbed functions over its prototype\'s and restore', function () { + simple.mock(obj, 'protoFn').returnWith('y') + assert.equal(obj.protoFn(), 'y') + assert(obj.protoFn.called) + simple.restore() + assert.equal(obj.protoFn(), 'x') + }) + + it('can mock with stubbed functions and prototype\'s original over its prototype\'s and restore', function () { + simple.mock(obj, 'protoFn').returnWith('y').callOriginal().returnWith('z') + assert.equal(obj.protoFn(), 'y') + assert.equal(obj.protoFn(), 'x') + assert.equal(obj.protoFn(), 'z') + assert.equal(obj.protoFn.callCount, 3) + simple.restore() + assert.equal(obj.protoFn(), 'x') + }) + }) + + describe('on an anonymous object', function () { + let obj: any + beforeEach(function () { + obj = { + a: 'a', + b: 'b', + c: 'c', + fnD: function () { + return 'd' + } + } + }) + + it('can mock instance values and restore', function () { + let beforeKeys = Object.keys(obj) + simple.mock(obj, 'a', 'd') + simple.mock(obj, 'd', 'a') + assert.equal(obj.a, 'd') + assert.equal(obj.d, 'a') + simple.restore() + assert.equal(obj.a, 'a') + assert.equal(obj.d, undefined) + assert.deepEqual(Object.keys(obj), beforeKeys) + }) + + it('can mock with spy on pre-existing functions and restore', function () { + simple.mock(obj, 'fnD').returnWith('a') + assert.equal(obj.fnD(), 'a') + assert(obj.fnD.called) + simple.restore() + assert.equal(obj.fnD(), 'd') + }) + + it('can mock with newly stubbed functions and restore', function () { + simple.mock(obj, 'fnA').returnWith('a') + assert.equal(obj.fnA(), 'a') + assert(obj.fnA.called) + simple.restore() + assert.equal(obj.fnA, undefined) + }) + }) + + describe('with one argument', function () { + it('returns a spy', function () { + let called = 0 + + let spy = simple.mock(function () { + called++ + }) + + spy() + assert.equal(called, 1) + assert(spy.called) + }) + }) + + describe('with no arguments', function () { + it('returns a stub', function () { + let stub = simple.mock().returnWith('x') + + let x = stub() + assert(stub.called) + assert(x, 'x') + }) + }) + }) +}) + +simple.Promise = Bluebird; diff --git a/simple-mock/simple-mock.d.ts b/simple-mock/simple-mock.d.ts new file mode 100644 index 000000000..760ef67b4 --- /dev/null +++ b/simple-mock/simple-mock.d.ts @@ -0,0 +1,194 @@ +// Type definitions for simple-mock +// Project: https://github.com/jupiter/simple-mock +// Definitions by: Leon Yu +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare namespace Simple { + type Fn = { + (...args: any[]): T + } + + export interface Static { + /** + * Restores all current mocks. + */ + restore(): void; + + /** + * Wraps fn in a spy and sets this on the obj, restorable with all mocks. + */ + mock(obj: any, key: string, fn: Fn): Stub; + + /** + * Sets the value on this object. E.g. mock(config, 'title', 'test') is the same as config.title = 'test', but restorable with all mocks. + */ + mock(obj: any, key: string, mockValue: T): T; + + /** + * If obj has already has this function, it is wrapped in a spy. The resulting spy can be turned into a stub by further configuration. Restores with all mocks. + */ + mock(obj: any, key: string): Stub; + mock(obj: any, key: string): Stub; + + /** + * Wraps fn in a spy. + */ + spy(fn: Fn): Spy; + /** + * Wraps fn in a spy. + */ + mock(fn: Fn): Spy; + + /** + * Returns a stub function that is also a spy. + */ + stub(): Stub; + stub(): Stub; + + /** + * Returns a stub function that is also a spy. + */ + mock(): Stub; + mock(): Stub; + + Promise?: PromiseConstructorLike; + } + + interface Calls { + /** + * an array of arguments received on the call + */ + args: any[]; + /** + * first argument + */ + arg: any; + /** + * the context (this) of the call + */ + context: any; + /** + * the value returned by the wrapped function + */ + returned: T; + /** + * the error thrown by the wrapped function + */ + threw: Error; + /** + * autoincrementing number, can be compared to evaluate call order + */ + k: number; + } + + export interface Spy{ + (...args: any[]): T; + + called: boolean; + /** + * Number of times the function was called. + */ + callCount: number; + calls: Calls[]; + firstCall: Calls; + /** + * The last call object. (This is often also the first and only call.) + */ + lastCall: Calls; + /** + * Resets all counts and properties to the original state. + */ + reset(): void; + } + + interface Action { + /** + * arguments to call back with + */ + cbArgs: ArrayLike; + returnValue: T; + throwError: Error; + } + + export interface Stub extends Spy { + /** + * Configures this stub to call this function, returning its return value. + * Subsequent calls of this on the same stub (chainable) will queue up different behaviours for each subsequent call of the stub. + */ + callFn(fn: Fn): Stub; + + /** + * Configures this stub to call the original, unstubbed function, returning its return value. + * Subsequent calls of this on the same stub (chainable) will queue up different behaviours for each subsequent call of the stub. + */ + callOriginal(): Stub; + + /** + * Configures this stub to return with this value. + * Subsequent calls of this on the same stub (chainable) will queue up different behaviours for each subsequent call of the stub. + */ + returnWith(val: R): Stub; + + /** + * Configures this stub to throw this error. + * Subsequent calls of this on the same stub (chainable) will queue up different behaviours for each subsequent call of the stub. + */ + throwWith(err: Error): Stub; + + /** + * Configures this stub to call back with the arguments passed. It will use either the last argument as callback, or the argument at cbArgumentIndex. + * Subsequent calls of this on the same stub (chainable) will queue up different behaviours for each subsequent call of the stub. + */ + callback(...args: any[]): Stub; + /** + * Configures this stub to call back with the arguments passed. It will use either the last argument as callback, or the argument at cbArgumentIndex. + * Subsequent calls of this on the same stub (chainable) will queue up different behaviours for each subsequent call of the stub. + */ + callbackWith(...args: any[]): Stub; + + /** + * Configures this stub to call back with the arguments passed. It will use either the last argument as callback, or the argument at cbArgumentIndex. + * Subsequent calls of this on the same stub (chainable) will queue up different behaviours for each subsequent call of the stub. + */ + callbackAtIndex(cbArgumentIndex: number, ...args: any[]): Stub; + /** + * Configures this stub to call back with the arguments passed. It will use either the last argument as callback, or the argument at cbArgumentIndex. + * Subsequent calls of this on the same stub (chainable) will queue up different behaviours for each subsequent call of the stub. + */ + callbackArgWith(cbArgumentIndex: number, ...args: any[]): Stub; + + + /** + * Configures the last configured function or callback to be called in this context, i.e. this will be obj. + */ + inThisContext(obj: any): Stub; + + /** + * Configures the stub to return a Promise (where available] resolving to this value. Same as stub.returnWith(Promise.resolve(val)). + * You can use a custom Promise-conforming library, i.e. simple.Promise = require('bluebird') or simple.Promise = $q. + */ + resolveWith(val: V): Stub>; + + /** + * Configures the stub to return a Promise (where available) rejecting with this error. Same as stub.returnWith(Promise.reject(val)). + * You can use a custom Promise-conforming library, i.e. simple.Promise = require('bluebird') or simple.Promise = $q. + */ + rejectWith(val: V): Stub>; + + /** + * An array of behaviours, each having one of these properties: + */ + actions: Action[]; + + /** + * setting whether the queue of actions for this stub should repeat. + * @default true + */ + loop: boolean; + } +} + +declare module "simple-mock" { + var simple: Simple.Static; + export = simple; +} From 4b57196684aa30d44373ab385104cab303041ded Mon Sep 17 00:00:00 2001 From: tlein Date: Fri, 4 Dec 2015 21:40:29 -0600 Subject: [PATCH 075/134] Add setStrokeDash to easeljs --- easeljs/easeljs-tests.ts | 1 + easeljs/easeljs.d.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/easeljs/easeljs-tests.ts b/easeljs/easeljs-tests.ts index b036ae570..c517dba2f 100644 --- a/easeljs/easeljs-tests.ts +++ b/easeljs/easeljs-tests.ts @@ -42,6 +42,7 @@ function test_animation() { function test_graphics() { var g = new createjs.Graphics(); g.setStrokeStyle(1); + g.setStrokeDash([20, 10], 20); g.beginStroke(createjs.Graphics.getRGB(0, 0, 0)); g.beginFill(createjs.Graphics.getRGB(255, 0, 0)); g.drawCircle(0, 0, 3); diff --git a/easeljs/easeljs.d.ts b/easeljs/easeljs.d.ts index 73b45b810..947c760e1 100644 --- a/easeljs/easeljs.d.ts +++ b/easeljs/easeljs.d.ts @@ -344,6 +344,7 @@ declare module createjs { quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): Graphics; rect(x: number, y: number, w: number, h: number): Graphics; setStrokeStyle(thickness: number, caps?: string | number, joints?: string | number, miterLimit?: number, ignoreScale?: boolean): Graphics; + setStrokeDash(segments?: number[], offset?: number): Graphics; store(): Graphics; toString(): string; unstore(): Graphics; @@ -377,6 +378,7 @@ declare module createjs { qt(cpx: number, cpy: number, x: number, y: number): Graphics; r(x: number, y: number, w: number, h: number): Graphics; ss(thickness: number, caps?: string | number, joints?: string | number, miterLimit?: number, ignoreScale?: boolean): Graphics; + sd(segments?: number[], offset?: number): Graphics; } From 2cecb066cea5029e3090f810d588e33fac5ca1dd Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Sat, 5 Dec 2015 00:05:30 -0500 Subject: [PATCH 076/134] Add react-bootstrap-daterangepicker definitions --- .../react-bootstrap-daterangepicker-tests.tsx | 7 +++++ .../react-bootstrap-daterangepicker.d.tsx | 29 +++++++++++++++++++ ...ct-bootstrap-daterangepicker.tsx.tscparams | 1 + 3 files changed, 37 insertions(+) create mode 100644 react-bootstrap-daterangepicker/react-bootstrap-daterangepicker-tests.tsx create mode 100644 react-bootstrap-daterangepicker/react-bootstrap-daterangepicker.d.tsx create mode 100644 react-bootstrap-daterangepicker/react-bootstrap-daterangepicker.tsx.tscparams diff --git a/react-bootstrap-daterangepicker/react-bootstrap-daterangepicker-tests.tsx b/react-bootstrap-daterangepicker/react-bootstrap-daterangepicker-tests.tsx new file mode 100644 index 000000000..a18e43013 --- /dev/null +++ b/react-bootstrap-daterangepicker/react-bootstrap-daterangepicker-tests.tsx @@ -0,0 +1,7 @@ +/// +/// + +import * as DateRangePicker from "react-bootstrap-daterangepicker"; +import * as React from "react"; + +let pickerCoponent = true} />; diff --git a/react-bootstrap-daterangepicker/react-bootstrap-daterangepicker.d.tsx b/react-bootstrap-daterangepicker/react-bootstrap-daterangepicker.d.tsx new file mode 100644 index 000000000..e80a258a4 --- /dev/null +++ b/react-bootstrap-daterangepicker/react-bootstrap-daterangepicker.d.tsx @@ -0,0 +1,29 @@ +// Type definitions for react-bootstrap-daterangepicker +// Project: https://github.com/skratchdot/react-bootstrap-daterangepicker +// Definitions by: Ian Ker-Seymer https://github.com/ianks +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module ReactBootstrapDaterangepicker { + export interface EventHandler { (event?: any, picker?: any): any; } + + export interface Props extends DatepickerOptions { + onShow?: EventHandler; + onHide?: EventHandler; + onShowCalendar?: EventHandler; + onHideCalendar?: EventHandler; + onApply?: EventHandler; + onCancel?: EventHandler; + onEvent?: EventHandler; + } + + export class DateRangePicker extends __React.Component {} +} + +declare var DateRangePicker: typeof ReactBootstrapDaterangepicker.DateRangePicker; + +declare module "react-bootstrap-daterangepicker" { + export = DateRangePicker; +} diff --git a/react-bootstrap-daterangepicker/react-bootstrap-daterangepicker.tsx.tscparams b/react-bootstrap-daterangepicker/react-bootstrap-daterangepicker.tsx.tscparams new file mode 100644 index 000000000..36c3b9323 --- /dev/null +++ b/react-bootstrap-daterangepicker/react-bootstrap-daterangepicker.tsx.tscparams @@ -0,0 +1 @@ +--noImplicitAny --module commonjs --jsx react From d2e216ec4fd6725fed01b72bd30635340b92dd9a Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sat, 5 Dec 2015 16:07:17 +0500 Subject: [PATCH 077/134] node: signatures of module "os" have been changed --- node/node-tests.ts | 47 ++++++++++++++++++++++++++++++++++++++++++++++ node/node.d.ts | 26 +++++++++++++++++++++++-- 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/node/node-tests.ts b/node/node-tests.ts index 930bd1a71..4ca651b33 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -14,6 +14,7 @@ import * as querystring from "querystring"; import * as path from "path"; import * as readline from "readline"; import * as childProcess from "child_process"; +import * as os from "os"; assert(1 + 1 - 2 === 0, "The universe isn't how it should."); @@ -411,3 +412,49 @@ rl.question("do you like typescript?", function(answer: string) { childProcess.exec("echo test"); childProcess.spawnSync("echo test"); + +//////////////////////////////////////////////////// +/// os tests : https://nodejs.org/api/os.html +//////////////////////////////////////////////////// + +module os_tests { + { + let result: string; + + result = os.tmpdir(); + result = os.homedir(); + result = os.endianness(); + result = os.hostname(); + result = os.type(); + result = os.platform(); + result = os.arch(); + result = os.release(); + result = os.EOL; + } + + { + let result: number; + + result = os.uptime(); + result = os.totalmem(); + result = os.freemem(); + } + + { + let result: number[]; + + result = os.loadavg(); + } + + { + let result: os.CpuInfo[]; + + result = os.cpus(); + } + + { + let result: {[index: string]: os.NetworkInterfaceInfo[]}; + + result = os.networkInterfaces(); + } +} diff --git a/node/node.d.ts b/node/node.d.ts index 017ca8e6b..39be040a4 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -698,7 +698,29 @@ declare module "zlib" { } declare module "os" { + export interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + } + } + + export interface NetworkInterfaceInfo { + address: string; + netmask: string; + family: string; + mac: string; + internal: boolean; + } + export function tmpdir(): string; + export function homedir(): string; + export function endianness(): string; export function hostname(): string; export function type(): string; export function platform(): string; @@ -708,8 +730,8 @@ declare module "os" { export function loadavg(): number[]; export function totalmem(): number; export function freemem(): number; - export function cpus(): { model: string; speed: number; times: { user: number; nice: number; sys: number; idle: number; irq: number; }; }[]; - export function networkInterfaces(): any; + export function cpus(): CpuInfo[]; + export function networkInterfaces(): {[index: string]: NetworkInterfaceInfo[]}; export var EOL: string; } From 14cc56099a4c90926839e406a87d36596d093708 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 5 Dec 2015 07:16:13 -0500 Subject: [PATCH 078/134] Overload then, catch, finally definitions --- request-promise/request-promise.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/request-promise/request-promise.d.ts b/request-promise/request-promise.d.ts index b35856277..6b5f23fd4 100644 --- a/request-promise/request-promise.d.ts +++ b/request-promise/request-promise.d.ts @@ -12,7 +12,13 @@ declare module 'request-promise' { import request = require('request'); import http = require('http'); - interface RequestPromise extends request.Request, Promise { + interface RequestPromise extends request.Request { + then(onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; + then(onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => void): Promise; + catch(onrejected?: (reason: any) => any | PromiseLike): Promise; + catch(onrejected?: (reason: any) => void): Promise; + finally(handler: () => PromiseLike): Promise; + finally(handler: () => TResult): Promise; promise(): Promise; } From 31def508ff755427b854e5b59a739fbb19cd15ff Mon Sep 17 00:00:00 2001 From: Sam Herrmann Date: Sat, 27 Jun 2015 16:41:10 -0400 Subject: [PATCH 079/134] Add AngularStrap type definitions As documented on the AngularStrap website: http://mgcrea.github.io/angular-strap/ --- angular-strap/angular-strap-tests.ts | 378 +++++++++++++++++ angular-strap/angular-strap.d.ts | 600 +++++++++++++++++++++++++++ 2 files changed, 978 insertions(+) create mode 100644 angular-strap/angular-strap-tests.ts create mode 100644 angular-strap/angular-strap.d.ts diff --git a/angular-strap/angular-strap-tests.ts b/angular-strap/angular-strap-tests.ts new file mode 100644 index 000000000..90c7a2bde --- /dev/null +++ b/angular-strap/angular-strap-tests.ts @@ -0,0 +1,378 @@ +/// +/// + +module angularStrapTests { + + import ngStrap = mgcrea.ngStrap; + + /////////////////////////////////////////////////////////////////////////// + // Modal + /////////////////////////////////////////////////////////////////////////// + + module modalTests { + + interface IDemoCtrlScope extends ngStrap.modal.IModalScope { + showModal: () => void; + } + + angular.module('demoApp') + .config($modalConfig) + .controller('demoCtrl', demoCtrl); + + function demoCtrl($scope: IDemoCtrlScope, + $modal: ngStrap.modal.IModalService): void { + + var myModalOptions: ngStrap.modal.IModalOptions = {}; + myModalOptions.title = 'My Title'; + myModalOptions.content = 'Hello Modal
This is a multiline message!'; + myModalOptions.show = true; + + var myModal = $modal(myModalOptions); + + var myOtherModalOptions: ngStrap.modal.IModalOptions = {}; + myOtherModalOptions.scope = $scope; + myOtherModalOptions.template = 'modal/docs/modal.demo.tpl.html'; + myOtherModalOptions.show = false; + + var myOtherModal = $modal(myOtherModalOptions); + + $scope.showModal = (): void => { + myOtherModal.$promise.then(myOtherModal.show); + }; + } + + function $modalConfig($modalProvider: ngStrap.modal.IModalProvider): void { + var defaults: ngStrap.modal.IModalOptions = { + animation: 'am-flip-x' + } + angular.extend($modalProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Aside + /////////////////////////////////////////////////////////////////////////// + + module asideTests { + + angular.module('demoApp') + .config($asideConfig) + .controller('demoCtrl', demoCtrl); + + function demoCtrl($scope: ngStrap.aside.IAsideScope, + $aside: ngStrap.aside.IAsideService): void { + + var myAsideOptions: ngStrap.aside.IAsideOptions = {}; + myAsideOptions.title = 'My Title'; + myAsideOptions.content = 'My content'; + myAsideOptions.show = true; + + var myAside = $aside(myAsideOptions); + + var myOtherAsideOptions: ngStrap.aside.IAsideOptions = {}; + myOtherAsideOptions.scope = $scope; + myOtherAsideOptions.template = 'aside/docs/aside.demo.tpl.html'; + + var myOtherAside = $aside(); + + myOtherAside.$promise.then(() => { + myOtherAside.show(); + }); + } + + function $asideConfig($asideProvider: ngStrap.aside.IAsideProvider): void { + var defaults: ngStrap.aside.IAsideOptions = {}; + defaults.animation = 'am-fadeAndSlideLeft'; + defaults.placement = 'left'; + + angular.extend($asideProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Alert + /////////////////////////////////////////////////////////////////////////// + + module alertTests { + + angular.module('demoApp') + .config($alertConfig) + .controller('demoCtrl', demoCtrl); + + function demoCtrl($scope: ngStrap.alert.IAlertScope, + $alert: ngStrap.alert.IAlertService): void { + + var options: ngStrap.alert.IAlertOptions = {}; + options.title = 'Holy guacamole!'; + options.content = 'Best check yo self, you\'re not looking too good.'; + options.placement = 'top'; + options.type = 'info'; + options.show = true; + + var myAlert = $alert(); + } + + function $alertConfig($alertProvider: ngStrap.alert.IAlertProvider): void { + var defaults: ngStrap.alert.IAlertOptions = {}; + defaults.animation = 'am-fade-and-slide-top'; + defaults.placement = 'top'; + + angular.extend($alertProvider.defaults, defaults); + }; + } + + + /////////////////////////////////////////////////////////////////////////// + // Tooltip + /////////////////////////////////////////////////////////////////////////// + + module tooltipTests { + + angular.module('demoApp') + .config($tooltipConfig) + .controller('demoDrct', demoDrct); + + function demoDrct($tooltip: ngStrap.tooltip.ITooltipService): ng.IDirective { + var drct: ng.IDirective = {}; + drct.restrict = 'EA'; + drct.link = link; + return drct; + + function link(scope: ng.IScope, elem: ng.IAugmentedJQuery, attrs: ng.IAttributes): void { + var options: ngStrap.tooltip.ITooltipOptions = {}; + options.title = 'My Title'; + $tooltip(elem, options); + } + } + + function $tooltipConfig($tooltipProvider: ngStrap.tooltip.ITooltipProvider): void { + var defaults: ngStrap.tooltip.ITooltipOptions = {}; + defaults.animation = 'am-flip-x'; + defaults.trigger = 'hover'; + + angular.extend($tooltipProvider.defaults, defaults); + }; + } + + + /////////////////////////////////////////////////////////////////////////// + // Popover + /////////////////////////////////////////////////////////////////////////// + + module popoverTests { + + angular.module('demoApp') + .config($popoverConfig) + .controller('demoDrct', demoDrct); + + function demoDrct($popover: ngStrap.popover.IPopoverService): ng.IDirective { + var drct: ng.IDirective = {}; + drct.restrict = 'EA'; + drct.link = link; + return drct; + + function link(scope: ng.IScope, elem: ng.IAugmentedJQuery, attrs: ng.IAttributes): void { + var options: ngStrap.tooltip.ITooltipOptions = {}; + options.title = 'My Title'; + + $popover(elem, options); + } + } + + function $popoverConfig($popoverProvider: ngStrap.popover.IPopoverProvider): void { + var defaults: ngStrap.tooltip.ITooltipOptions = {} + defaults.animation = 'am-flip-x'; + defaults.trigger = 'hover'; + + angular.extend($popoverProvider.defaults, defaults); + }; + } + + + /////////////////////////////////////////////////////////////////////////// + // Typeahead + /////////////////////////////////////////////////////////////////////////// + + module typeaheadTests { + + angular.module('myApp') + .config($typeaheadConfig); + + function $typeaheadConfig($typeaheadProvider: ngStrap.typeahead.ITypeaheadProvider) { + var defaults: ngStrap.typeahead.ITypeaheadOptions = {} + defaults.animation = 'am-flip-x'; + defaults.minLength = 2; + defaults.limit = 8; + + angular.extend($typeaheadProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Datepicker + /////////////////////////////////////////////////////////////////////////// + + module datepickerTests { + + angular.module('myApp') + .config($datepickerConfig); + + function $datepickerConfig($datepickerProvider: ngStrap.datepicker.IDatepickerProvider): void { + var defaults: ngStrap.datepicker.IDatepickerOptions = {}; + defaults.dateFormat = 'dd/MM/yyyy'; + defaults.startWeek = 1; + + angular.extend($datepickerProvider.defaults, defaults); + }; + } + + + /////////////////////////////////////////////////////////////////////////// + // Timepicker + /////////////////////////////////////////////////////////////////////////// + + module timepickerTests { + + angular.module('myApp') + .config($timepickerConfig); + + function $timepickerConfig($timepickerProvider: ngStrap.timepicker.ITimepickerProvider): void { + var defaults: ngStrap.timepicker.ITimepickerOptions = {}; + defaults.timeFormat = 'HH:mm'; + defaults.length = 7; + + angular.extend($timepickerProvider.defaults, defaults); + }; + } + + + /////////////////////////////////////////////////////////////////////////// + // Select + /////////////////////////////////////////////////////////////////////////// + + module selectTests { + + angular.module('myApp') + .config($selectConfig); + + function $selectConfig($selectProvider: ngStrap.select.ISelectProvider): void { + var defaults: ngStrap.select.ISelectOptions = {}; + defaults.animation = 'am-flip-x'; + defaults.sort = false; + + angular.extend($selectProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Tabs + /////////////////////////////////////////////////////////////////////////// + + module tabTests { + + angular.module('myApp') + .config($tabConfig); + + function $tabConfig($tabProvider: ngStrap.tab.ITabProvider) { + var defaults: ngStrap.tab.ITabOptions = {}; + defaults.animation = 'am-flip-x'; + + angular.extend($tabProvider.defaults, defaults); + } + } + + /////////////////////////////////////////////////////////////////////////// + // Collapse + /////////////////////////////////////////////////////////////////////////// + + module collapseTests { + + angular.module('myApp') + .config($collapseConfig); + + function $collapseConfig($collapseProvider: ngStrap.collapse.ICollapseProvider):void { + var defaults: ngStrap.collapse.ICollapseOptions = {}; + defaults.animation = 'am-flip-x'; + + angular.extend($collapseProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Dropdown + /////////////////////////////////////////////////////////////////////////// + + module dropdownTests { + + angular.module('myApp') + .config($dropdownConfig); + + function $dropdownConfig($dropdownProvider: ngStrap.dropdown.IDropdownProvider):void { + var defaults: ngStrap.dropdown.IDropdownOptions = {}; + defaults.animation = 'am-flip-x'; + defaults.trigger = 'hover'; + + angular.extend($dropdownProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Navbar + /////////////////////////////////////////////////////////////////////////// + + module navbarTests { + + angular.module('myApp') + .config($navbarConfig); + + function $navbarConfig($navbarProvider: ngStrap.navbar.INavbarProvider):void { + var defaults: ngStrap.navbar.INavbarOptions = {}; + defaults.activeClass = 'in'; + + angular.extend($navbarProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Scrollspy + /////////////////////////////////////////////////////////////////////////// + + module scrollspyTests { + + angular.module('myApp') + .config($scrollspyConfig); + + function $scrollspyConfig($scrollspyProvider: ngStrap.scrollspy.IScrollspyProvider):void { + var defaults: ngStrap.scrollspy.IScrollspyOptions = {}; + defaults.offset = 0; + defaults.target = 'my-selector'; + + angular.extend($scrollspyProvider.defaults, defaults); + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Affix + /////////////////////////////////////////////////////////////////////////// + + module affixTests { + + angular.module('myApp') + .config($affixConfig); + + function $affixConfig($affixProvider: ngStrap.affix.IAffixProvider):void { + var defaults: ngStrap.affix.IAffixOptions = {}; + defaults.offsetTop = 100; + + angular.extend($affixProvider.defaults, defaults); + } + } +} \ No newline at end of file diff --git a/angular-strap/angular-strap.d.ts b/angular-strap/angular-strap.d.ts new file mode 100644 index 000000000..10e46bc1c --- /dev/null +++ b/angular-strap/angular-strap.d.ts @@ -0,0 +1,600 @@ +// Type definitions for angular-strap v2.2.x +// Project: http://mgcrea.github.io/angular-strap/ +// Definitions by: Sam Herrmann +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +declare module mgcrea.ngStrap { + + /////////////////////////////////////////////////////////////////////////// + // Modal + // see http://mgcrea.github.io/angular-strap/#/modals + /////////////////////////////////////////////////////////////////////////// + + module modal { + + interface IModalService { + (config?: IModalOptions): IModal; + } + + interface IModalProvider { + defaults: IModalOptions; + } + + interface IModal { + $promise: ng.IPromise; + show: () => void; + hide: () => void; + toggle: () => void; + } + + interface IModalOptions { + animation?: string; + backdropAnimation?: string; + placement?: string; + title?: string; + content?: string; + html?: boolean; + backdrop?: boolean | string; + keyboard?: boolean; + show?: boolean; + container?: string | boolean; + template?: string; + contentTemplate?: string; + prefixEvent?: string; + id?: string; + scope?: ng.IScope; + } + + interface IModalScope extends ng.IScope { + $show: () => void; + $hide: () => void; + $toggle: () => void; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Aside + // see http://mgcrea.github.io/angular-strap/#/asides + /////////////////////////////////////////////////////////////////////////// + + module aside { + + interface IAsideService { + (config?: IAsideOptions): IAside; + } + + interface IAsideProvider { + defaults: IAsideOptions; + } + + interface IAside { + $promise: ng.IPromise; + show: () => void; + hide: () => void; + toggle: () => void; + } + + interface IAsideOptions { + animation?: string; + placement?: string; + title?: string; + content?: string; + html?: boolean; + backdrop?: boolean | string; + keyboard?: boolean; + show?: boolean; + container?: string | boolean; + template?: string; + contentTemplate?: string; + scope?: ng.IScope; + } + + interface IAsideScope extends ng.IScope { + $show: () => void; + $hide: () => void; + $toggle: () => void; + } + } + + + + /////////////////////////////////////////////////////////////////////////// + // Alert + // see http://mgcrea.github.io/angular-strap/#/alerts + /////////////////////////////////////////////////////////////////////////// + + module alert { + + interface IAlertService { + (config?: IAlertOptions): IAlert; + } + + interface IAlertProvider { + defaults: IAlertOptions; + } + + interface IAlert { + $promise: ng.IPromise; + show: () => void; + hide: () => void; + toggle: () => void; + } + + interface IAlertOptions { + animation?: string; + placement?: string; + title?: string; + content?: string; + type?: string; + keyboard?: boolean; + show?: boolean; + container?: string | boolean; + template?: string; + duration?: number | boolean; + dismissable?: boolean; + } + + interface IAlertScope extends ng.IScope { + $show: () => void; + $hide: () => void; + $toggle: () => void; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Tooltip + // see http://mgcrea.github.io/angular-strap/#/tooltips + /////////////////////////////////////////////////////////////////////////// + + module tooltip { + + interface ITooltipService { + (element: ng.IAugmentedJQuery, config?: ITooltipOptions): ITooltip; + } + + interface ITooltipProvider { + defaults: ITooltipOptions; + } + + interface ITooltip { + $promise: ng.IPromise; + show: () => void; + hide: () => void; + toggle: () => void; + } + + interface ITooltipOptions { + animation?: string; + placement?: string; + trigger?: string; + title?: string; + html?: boolean; + delay?: number | { show: number; hide: number}; + container?: string | boolean; + target?: string | ng.IAugmentedJQuery | boolean; + template?: string; + contentTemplate?: string; + prefixEvent?: string; + id?: string; + viewport?: string | { selector: string; padding: string | number }; + } + + interface ITooltipScope extends ng.IScope { + $show: () => void; + $hide: () => void; + $toggle: () => void; + $setEnabled: (isEnabled: boolean) => void; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Popover + // see http://mgcrea.github.io/angular-strap/#/popovers + /////////////////////////////////////////////////////////////////////////// + + module popover { + + interface IPopoverService { + (element: ng.IAugmentedJQuery, config?: IPopoverOptions): IPopover; + } + + interface IPopoverProvider { + defaults: IPopoverOptions; + } + + interface IPopover { + $promise: ng.IPromise; + show: () => void; + hide: () => void; + toggle: () => void; + } + + interface IPopoverOptions { + animation?: string; + placement?: string; + trigger?: string; + title?: string; + content?: string; + html?: boolean; + delay?: number | { show: number; hide: number }; + container?: string | boolean; + target?: string | ng.IAugmentedJQuery | boolean; + template?: string; + contentTemplate?: string; + autoClose?: boolean; + id?: string; + viewport?: string | { selector: string; padding: string | number }; + } + + interface IPopoverScope extends ng.IScope { + $show: () => void; + $hide: () => void; + $toggle: () => void; + } + } + + + + /////////////////////////////////////////////////////////////////////////// + // Typeahead + // see http://mgcrea.github.io/angular-strap/#/typeaheads + /////////////////////////////////////////////////////////////////////////// + + module typeahead { + + interface ITypeaheadService { + (element: ng.IAugmentedJQuery, controller: any, config?: ITypeaheadOptions): ITypeahead; + } + + interface ITypeaheadProvider { + defaults: ITypeaheadOptions; + } + + interface ITypeahead { + $promise: ng.IPromise; + show: () => void; + hide: () => void; + toggle: () => void; + } + + interface ITypeaheadOptions { + animation?: string; + placement?: string; + trigger?: string; + html?: boolean; + delay?: number | { show: number; hide: number }; + container?: string | boolean; + template?: string; + limit?: number; + minLength?: number; + autoSelect?: boolean; + comparator?: string; + id?: string; + watchOptions?: boolean; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Datepicker + // see http://mgcrea.github.io/angular-strap/#/datepickers + /////////////////////////////////////////////////////////////////////////// + + module datepicker { + + interface IDatepickerService { + (element: ng.IAugmentedJQuery, controller: any, config?: IDatepickerOptions): IDatepicker; + } + + interface IDatepickerProvider { + defaults: IDatepickerOptions; + } + + interface IDatepicker { + update: (date: Date) => void; + updateDisabledDates: (dateRanges: IDatepickerDateRange[]) => void; + select: (dateConstructorArg: string | number | number[], keep: boolean) => void; + setMode: (mode: any) => void; + int: () => void; + destroy: () => void; + show: () => void; + hide: () => void; + } + + interface IDatepickerDateRange { + start: Date; + end: Date; + } + + interface IDatepickerOptions { + animation?: string; + placement?: string; + trigger?: string; + html?: boolean; + delay?: number | { show: number; hide: number }; + container?: string | boolean; + template?: string; + dateFormat?: string; + modelDateFormat?: string; + dateType?: string; + timezone?: string; + autoclose?: boolean; + useNative?: boolean; + minDate?: Date; + maxDate?: Date; + startView?: number; + minView?: number; + startWeek?: number; + startDate?: Date; + iconLeft?: string; + iconRight?: string; + daysOfWeekDisabled?: string; + disabledDates?: IDatepickerDateRange[]; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Timepicker + // see http://mgcrea.github.io/angular-strap/#/timepickers + /////////////////////////////////////////////////////////////////////////// + + module timepicker { + + interface ITimepickerService { + (element: ng.IAugmentedJQuery, controller: any, config?: ITimepickerOptions): ITimepicker; + } + + interface ITimepickerProvider { + defaults: ITimepickerOptions; + } + + interface ITimepicker { + + } + + interface ITimepickerOptions { + animation?: string; + placement?: string; + trigger?: string; + html?: boolean; + delay?: number | { show: number; hide: number; }; + container?: string | boolean; + template?: string; + timeFormat?: string; + modelTimeFormat?: string; + timeType?: string; + autoclose?: boolean; + useNative?: boolean; + minTime?: Date; // TODO + maxTime?: Date; // TODO + length?: number; + hourStep?: number; + minuteStep?: number; + secondStep?: number; + roundDisplay?: boolean; + iconUp?: string; + iconDown?: string; + arrowBehaviour?: string; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Button + // see http://mgcrea.github.io/angular-strap/#/buttons + /////////////////////////////////////////////////////////////////////////// + + // No definitions for this module + + + /////////////////////////////////////////////////////////////////////////// + // Select + // see http://mgcrea.github.io/angular-strap/#/selects + /////////////////////////////////////////////////////////////////////////// + + module select { + + interface ISelectService { + (element: ng.IAugmentedJQuery, controller: any, config: ISelectOptions): ISelect; + } + + interface ISelectProvider { + defaults: ISelectOptions; + } + + interface ISelect { + update: (matches: any) => void; + active: (index: number) => number; + select: (index: number) => void; + show: () => void; + hide: () => void; + } + + interface ISelectOptions { + animation?: string; + placement?: string; + trigger?: string; + html?: boolean; + delay?: number | { show: number; hide: number; }; + container?: string | boolean; + template?: string; + multiple?: boolean; + allNoneButtons?: boolean; + allText?: string; + noneText?: string; + maxLength?: number; + maxLengthHtml?: string; + sort?: boolean; + placeholder?: string; + iconCheckmark?: string; + id?: string; + } + } + + /////////////////////////////////////////////////////////////////////////// + // Tabs + // see http://mgcrea.github.io/angular-strap/#/tabs + /////////////////////////////////////////////////////////////////////////// + + module tab { + + interface ITabProvider { + defaults: ITabOptions; + } + + interface ITabService { + defaults: ITabOptions; + controller: any; + } + + interface ITabOptions { + animation?: string; + template?: string; + navClass?: string; + activeClass?: string; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Collapses + // see http://mgcrea.github.io/angular-strap/#/collapses + /////////////////////////////////////////////////////////////////////////// + + module collapse { + + interface ICollapseProvider { + defaults: ICollapseOptions; + } + + interface ICollapseOptions { + animation?: string; + activeClass?: string; + disallowToggle?: boolean; + startCollapsed?: boolean; + allowMultiple?: boolean; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Dropdowsn + // see http://mgcrea.github.io/angular-strap/#/dropdowns + /////////////////////////////////////////////////////////////////////////// + + module dropdown { + + interface IDropdownProvider { + defaults: IDropdownOptions; + } + + interface IDropdownService { + (element: ng.IAugmentedJQuery, config: IDropdownOptions): IDropdown; + } + + interface IDropdown { + show: () => void; + hide: () => void; + destroy: () => void; + } + + interface IDropdownOptions { + animation?: string; + placement?: string; + trigger?: string; + html?: boolean; + delay?: number | { show: number; hide: number; }; + container?: string | boolean; + template?: string; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Navbar + // see http://mgcrea.github.io/angular-strap/#/navbars + /////////////////////////////////////////////////////////////////////////// + + module navbar { + + interface INavbarProvider { + defaults: INavbarOptions; + } + + interface INavbarOptions { + activeClass?: string; + routeAttr?: string; + } + + interface INavbarService { + defaults: INavbarOptions; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Scrollspy + // see http://mgcrea.github.io/angular-strap/#/scrollspy + /////////////////////////////////////////////////////////////////////////// + + module scrollspy { + + interface IScrollspyProvider { + defaults: IScrollspyOptions; + } + + interface IScrollspyService { + (element: ng.IAugmentedJQuery, options: IScrollspyOptions): IScrollspy; + } + + interface IScrollspy { + checkOffsets: () => void; + trackElement: (target: any, source: any) => void; + untrackElement: (target: any, source: any) => void; + activate: (index: number) => void; + } + + interface IScrollspyOptions { + target?: string; + offset?: number; + } + } + + + /////////////////////////////////////////////////////////////////////////// + // Affix + // see http://mgcrea.github.io/angular-strap/#/affix + /////////////////////////////////////////////////////////////////////////// + + module affix { + + interface IAffixProvider { + defaults: IAffixOptions; + } + + interface IAffixService { + (element: ng.IAugmentedJQuery, options: IAffixOptions): IAffix; + } + + interface IAffix { + init: () => void; + destroy: () => void; + checkPositionWithEventLoop: () => void; + checkPosition: () => void; + } + + interface IAffixOptions { + offsetTop?: number; + offsetBottom?: number; + offsetParent?: number; + offsetUnpin?: number; + } + } +} From f913f681ac646953c312343d8c0a2c76105fb409 Mon Sep 17 00:00:00 2001 From: Ahto Jussila Date: Sat, 5 Dec 2015 17:55:44 +0200 Subject: [PATCH 080/134] allow arbitrary key names when setting defaults --- nconf/nconf-tests.ts | 2 ++ nconf/nconf.d.ts | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nconf/nconf-tests.ts b/nconf/nconf-tests.ts index 7037abfb6..673c05dca 100644 --- a/nconf/nconf-tests.ts +++ b/nconf/nconf-tests.ts @@ -48,6 +48,8 @@ p = nconf.use(str, opts); p = nconf.defaults(); p = nconf.defaults(opts); +p = nconf.defaults({foo: 'bar'}); + nconf.init(); nconf.init(opts); diff --git a/nconf/nconf.d.ts b/nconf/nconf.d.ts index ee59591fd..8453bfca8 100644 --- a/nconf/nconf.d.ts +++ b/nconf/nconf.d.ts @@ -48,11 +48,12 @@ declare module "nconf" { parse: (str: string) => any; } - export interface IOptions { - type?: string; + export interface IOptions { + [index: string]: any; } - export interface IFileOptions extends IOptions { + export interface IFileOptions { + type?: string; file?: string; dir?: string; search?: boolean; From d54b18e0ac3277376700b6026ef9e9e3f380df50 Mon Sep 17 00:00:00 2001 From: Peter Burns Date: Sat, 5 Dec 2015 10:39:59 -0800 Subject: [PATCH 081/134] ProgressBar should also be a module, for ES6 importing --- progress/progress.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progress/progress.d.ts b/progress/progress.d.ts index 2c7e683ec..afb8ccf73 100644 --- a/progress/progress.d.ts +++ b/progress/progress.d.ts @@ -115,7 +115,7 @@ declare module "progress" */ terminate():void; } - + module ProgressBar { } export = ProgressBar; } From d4c62f32974272b0133a2b45fd1b1585a2531b71 Mon Sep 17 00:00:00 2001 From: Vinh Tran Date: Sat, 5 Dec 2015 15:15:10 -0500 Subject: [PATCH 082/134] Update interface DirectionRequest Added ```LatLngLiteral``` as an option type for ```origin``` and ```destination``` fields for DirectionRequest. Reference: [https://developers.google.com/maps/documentation/javascript/reference#Place](https://developers.google.com/maps/documentation/javascript/reference#Place) --- googlemaps/google.maps.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index 770151f33..87b10991e 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -911,10 +911,10 @@ declare module google.maps { avoidFerries?: boolean; avoidHighways?: boolean; avoidTolls?: boolean; - destination?: LatLng|string; + destination?: LatLng|LatLngLiteral|string; durationInTraffic?: boolean; optimizeWaypoints?: boolean; - origin?: LatLng|string; + origin?: LatLng|LatLngLiteral|string; provideRouteAlternatives?: boolean; region?: string; transitOptions?: TransitOptions; From 4f1c2d48e09fb33d65c7b4241ba09453f1ce7820 Mon Sep 17 00:00:00 2001 From: Vinh Tran Date: Sat, 5 Dec 2015 15:52:10 -0500 Subject: [PATCH 083/134] Update DirectionsWaypoint's location field optional types --- googlemaps/google.maps.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index 87b10991e..699115473 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -959,7 +959,7 @@ declare module google.maps { export interface TransitFare { } export interface DirectionsWaypoint { - location: LatLng|string; + location: LatLng|LatLngLiteral|string; stopover: boolean; } From f08f279bd095ac9a197fea3ce4767de3e5dce493 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Sun, 6 Dec 2015 01:25:08 +0100 Subject: [PATCH 084/134] Add more detailed types to Chrome storage callbacks --- chrome/chrome-tests.ts | 8 ++ chrome/chrome.d.ts | 255 +++++++++++++++++++++-------------------- 2 files changed, 136 insertions(+), 127 deletions(-) diff --git a/chrome/chrome-tests.ts b/chrome/chrome-tests.ts index 341738435..e184a8216 100644 --- a/chrome/chrome-tests.ts +++ b/chrome/chrome-tests.ts @@ -254,3 +254,11 @@ function testOptionsPage() { }); } +chrome.storage.sync.get("myKey", function (loadedData) { + var myValue: { x: number } = loadedData["myKey"]; +}); + +chrome.storage.onChanged.addListener(function (changes) { + var myNewValue: { x: number } = changes["myKey"].newValue; + var myOldValue: { x: number } = changes["myKey"].oldValue; +}); diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index b27891704..3d8039fc1 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -5866,139 +5866,140 @@ declare module chrome.sessions { * @since Chrome 20. */ declare module chrome.storage { - interface StorageArea { - /** - * Gets the amount of space (in bytes) being used by one or more items. - * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). - * Parameter bytesInUse: Amount of space being used in storage, in bytes. - */ - getBytesInUse(callback: (bytesInUse: number) => void): void; - /** - * Gets the amount of space (in bytes) being used by one or more items. - * @param key A single key to get the total usage for. Pass in null to get the total usage of all of storage. - * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). - * Parameter bytesInUse: Amount of space being used in storage, in bytes. - */ - getBytesInUse(key: string, callback: (bytesInUse: number) => void): void; - /** - * Gets the amount of space (in bytes) being used by one or more items. - * @param keys A list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage. - * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). - * Parameter bytesInUse: Amount of space being used in storage, in bytes. - */ - getBytesInUse(keys: string[], callback: (bytesInUse: number) => void): void; - /** - * Removes all items from storage. - * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). - */ - clear(callback?: () => void): void; - /** - * Sets multiple items. - * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected. - * Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation). - * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). - */ - set(items: Object, callback?: () => void): void; - /** - * Removes one item from storage. - * @param key A single key for items to remove. - * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). - */ - remove(key: string, callback?: () => void): void; - /** - * Removes items from storage. - * @param keys A list of keys for items to remove. - * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). - */ - remove(keys: string[], callback?: () => void): void; - /** - * Gets one or more items from storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. - */ - get(callback: (items: Object) => void): void; - /** - * Gets one or more items from storage. - * @param key A single key to get. Pass in null to get the entire contents of storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. - */ - get(key: string, callback: (items: Object) => void): void; - /** - * Gets one or more items from storage. - * @param keys A list of keys to get. An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. - */ - get(keys: string[], callback: (items: Object) => void): void; - /** - * Gets one or more items from storage. - * @param keys A dictionary specifying default values. Pass in null to get the entire contents of storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. - */ - get(keys: Object, callback: (items: Object) => void): void; - } + interface StorageArea { + /** + * Gets the amount of space (in bytes) being used by one or more items. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. + */ + getBytesInUse(callback: (bytesInUse: number) => void): void; + /** + * Gets the amount of space (in bytes) being used by one or more items. + * @param key A single key to get the total usage for. Pass in null to get the total usage of all of storage. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. + */ + getBytesInUse(key: string, callback: (bytesInUse: number) => void): void; + /** + * Gets the amount of space (in bytes) being used by one or more items. + * @param keys A list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. + */ + getBytesInUse(keys: string[], callback: (bytesInUse: number) => void): void; + /** + * Removes all items from storage. + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + clear(callback?: () => void): void; + /** + * Sets multiple items. + * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected. + * Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation). + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + set(items: Object, callback?: () => void): void; + /** + * Removes one item from storage. + * @param key A single key for items to remove. + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + remove(key: string, callback?: () => void): void; + /** + * Removes items from storage. + * @param keys A list of keys for items to remove. + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + remove(keys: string[], callback?: () => void): void; + /** + * Gets one or more items from storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(callback: (items: { [key: string]: any }) => void): void; + /** + * Gets one or more items from storage. + * @param key A single key to get. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(key: string, callback: (items: { [key: string]: any }) => void): void; + /** + * Gets one or more items from storage. + * @param keys A list of keys to get. An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(keys: string[], callback: (items: { [key: string]: any }) => void): void; + /** + * Gets one or more items from storage. + * @param keys A dictionary specifying default values. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(keys: Object, callback: (items: { [key: string]: any }) => void): void; + } - interface StorageChange { - /** Optional. The new value of the item, if there is a new value. */ - newValue?: any; - /** Optional. The old value of the item, if there was an old value. */ - oldValue?: any; - } + interface StorageChange { + /** Optional. The new value of the item, if there is a new value. */ + newValue?: any; + /** Optional. The old value of the item, if there was an old value. */ + oldValue?: any; + } - interface LocalStorageArea extends StorageArea { - /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ - QUOTA_BYTES: number; - } + interface LocalStorageArea extends StorageArea { + /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ + QUOTA_BYTES: number; + } - interface SyncStorageArea extends StorageArea { - /** @deprecated since Chrome 40. The storage.sync API no longer has a sustained write operation quota. */ - MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; - /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ - QUOTA_BYTES: number; - /** The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set runtime.lastError. */ - QUOTA_BYTES_PER_ITEM: number; - /** The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set runtime.lastError. */ - MAX_ITEMS: number; - /** - * The maximum number of set, remove, or clear operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit. - * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. - */ - MAX_WRITE_OPERATIONS_PER_HOUR: number; - /** - * The maximum number of set, remove, or clear operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time. - * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. - * @since Chrome 40. - */ - MAX_WRITE_OPERATIONS_PER_MINUTE: number; - } + interface SyncStorageArea extends StorageArea { + /** @deprecated since Chrome 40. The storage.sync API no longer has a sustained write operation quota. */ + MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; + /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ + QUOTA_BYTES: number; + /** The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set runtime.lastError. */ + QUOTA_BYTES_PER_ITEM: number; + /** The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set runtime.lastError. */ + MAX_ITEMS: number; + /** + * The maximum number of set, remove, or clear operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit. + * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. + */ + MAX_WRITE_OPERATIONS_PER_HOUR: number; + /** + * The maximum number of set, remove, or clear operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time. + * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. + * @since Chrome 40. + */ + MAX_WRITE_OPERATIONS_PER_MINUTE: number; + } - interface StorageChangedEvent extends chrome.events.Event { - /** - * @param callback - * Parameter changes: Object mapping each key that changed to its corresponding storage.StorageChange for that item. - * Parameter areaName: Since Chrome 22. The name of the storage area ("sync", "local" or "managed") the changes are for. - */ - addListener(callback: (changes: Object, areaName: string) => void): void; - } + interface StorageChangedEvent extends chrome.events.Event { + /** + * @param callback + * Parameter changes: Object mapping each key that changed to its corresponding storage.StorageChange for that item. + * Parameter areaName: Since Chrome 22. The name of the storage area ("sync", "local" or "managed") the changes are for. + */ + addListener(callback: (changes: { [key: string]: StorageChange }, areaName: string) => void): void; + } - /** Items in the local storage area are local to each machine. */ - var local: LocalStorageArea; - /** Items in the sync storage area are synced using Chrome Sync. */ - var sync: SyncStorageArea; - /** - * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. - * @since Chrome 33. - */ - var managed: StorageArea; + /** Items in the local storage area are local to each machine. */ + var local: LocalStorageArea; + /** Items in the sync storage area are synced using Chrome Sync. */ + var sync: SyncStorageArea; - /** Fired when one or more items change. */ - var onChanged: StorageChangedEvent; + /** + * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. + * @since Chrome 33. + */ + var managed: StorageArea; + + /** Fired when one or more items change. */ + var onChanged: StorageChangedEvent; } //////////////////// From efd7d6ca8a4da4a9c89d28dd0d95a2f2a9830be2 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Sun, 6 Dec 2015 01:34:49 +0100 Subject: [PATCH 085/134] Fix up chrome storage indentation properly while I'm here --- chrome/chrome.d.ts | 254 ++++++++++++++++++++++----------------------- 1 file changed, 127 insertions(+), 127 deletions(-) diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index 3d8039fc1..7db591be2 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -5866,140 +5866,140 @@ declare module chrome.sessions { * @since Chrome 20. */ declare module chrome.storage { - interface StorageArea { - /** - * Gets the amount of space (in bytes) being used by one or more items. - * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). - * Parameter bytesInUse: Amount of space being used in storage, in bytes. - */ - getBytesInUse(callback: (bytesInUse: number) => void): void; - /** - * Gets the amount of space (in bytes) being used by one or more items. - * @param key A single key to get the total usage for. Pass in null to get the total usage of all of storage. - * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). - * Parameter bytesInUse: Amount of space being used in storage, in bytes. - */ - getBytesInUse(key: string, callback: (bytesInUse: number) => void): void; - /** - * Gets the amount of space (in bytes) being used by one or more items. - * @param keys A list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage. - * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). - * Parameter bytesInUse: Amount of space being used in storage, in bytes. - */ - getBytesInUse(keys: string[], callback: (bytesInUse: number) => void): void; - /** - * Removes all items from storage. - * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). - */ - clear(callback?: () => void): void; - /** - * Sets multiple items. - * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected. - * Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation). - * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). - */ - set(items: Object, callback?: () => void): void; - /** - * Removes one item from storage. - * @param key A single key for items to remove. - * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). - */ - remove(key: string, callback?: () => void): void; - /** - * Removes items from storage. - * @param keys A list of keys for items to remove. - * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). - */ - remove(keys: string[], callback?: () => void): void; - /** - * Gets one or more items from storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. - */ - get(callback: (items: { [key: string]: any }) => void): void; - /** - * Gets one or more items from storage. - * @param key A single key to get. Pass in null to get the entire contents of storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. - */ - get(key: string, callback: (items: { [key: string]: any }) => void): void; - /** - * Gets one or more items from storage. - * @param keys A list of keys to get. An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. - */ - get(keys: string[], callback: (items: { [key: string]: any }) => void): void; - /** - * Gets one or more items from storage. - * @param keys A dictionary specifying default values. Pass in null to get the entire contents of storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. - */ - get(keys: Object, callback: (items: { [key: string]: any }) => void): void; - } + interface StorageArea { + /** + * Gets the amount of space (in bytes) being used by one or more items. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. + */ + getBytesInUse(callback: (bytesInUse: number) => void): void; + /** + * Gets the amount of space (in bytes) being used by one or more items. + * @param key A single key to get the total usage for. Pass in null to get the total usage of all of storage. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. + */ + getBytesInUse(key: string, callback: (bytesInUse: number) => void): void; + /** + * Gets the amount of space (in bytes) being used by one or more items. + * @param keys A list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. + */ + getBytesInUse(keys: string[], callback: (bytesInUse: number) => void): void; + /** + * Removes all items from storage. + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + clear(callback?: () => void): void; + /** + * Sets multiple items. + * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected. + * Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation). + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + set(items: Object, callback?: () => void): void; + /** + * Removes one item from storage. + * @param key A single key for items to remove. + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + remove(key: string, callback?: () => void): void; + /** + * Removes items from storage. + * @param keys A list of keys for items to remove. + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + remove(keys: string[], callback?: () => void): void; + /** + * Gets one or more items from storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(callback: (items: { [key: string]: any }) => void): void; + /** + * Gets one or more items from storage. + * @param key A single key to get. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(key: string, callback: (items: { [key: string]: any }) => void): void; + /** + * Gets one or more items from storage. + * @param keys A list of keys to get. An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(keys: string[], callback: (items: { [key: string]: any }) => void): void; + /** + * Gets one or more items from storage. + * @param keys A dictionary specifying default values. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(keys: Object, callback: (items: { [key: string]: any }) => void): void; + } - interface StorageChange { - /** Optional. The new value of the item, if there is a new value. */ - newValue?: any; - /** Optional. The old value of the item, if there was an old value. */ - oldValue?: any; - } + interface StorageChange { + /** Optional. The new value of the item, if there is a new value. */ + newValue?: any; + /** Optional. The old value of the item, if there was an old value. */ + oldValue?: any; + } - interface LocalStorageArea extends StorageArea { - /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ - QUOTA_BYTES: number; - } + interface LocalStorageArea extends StorageArea { + /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ + QUOTA_BYTES: number; + } - interface SyncStorageArea extends StorageArea { - /** @deprecated since Chrome 40. The storage.sync API no longer has a sustained write operation quota. */ - MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; - /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ - QUOTA_BYTES: number; - /** The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set runtime.lastError. */ - QUOTA_BYTES_PER_ITEM: number; - /** The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set runtime.lastError. */ - MAX_ITEMS: number; - /** - * The maximum number of set, remove, or clear operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit. - * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. - */ - MAX_WRITE_OPERATIONS_PER_HOUR: number; - /** - * The maximum number of set, remove, or clear operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time. - * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. - * @since Chrome 40. - */ - MAX_WRITE_OPERATIONS_PER_MINUTE: number; - } + interface SyncStorageArea extends StorageArea { + /** @deprecated since Chrome 40. The storage.sync API no longer has a sustained write operation quota. */ + MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; + /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ + QUOTA_BYTES: number; + /** The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set runtime.lastError. */ + QUOTA_BYTES_PER_ITEM: number; + /** The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set runtime.lastError. */ + MAX_ITEMS: number; + /** + * The maximum number of set, remove, or clear operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit. + * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. + */ + MAX_WRITE_OPERATIONS_PER_HOUR: number; + /** + * The maximum number of set, remove, or clear operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time. + * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. + * @since Chrome 40. + */ + MAX_WRITE_OPERATIONS_PER_MINUTE: number; + } - interface StorageChangedEvent extends chrome.events.Event { - /** - * @param callback - * Parameter changes: Object mapping each key that changed to its corresponding storage.StorageChange for that item. - * Parameter areaName: Since Chrome 22. The name of the storage area ("sync", "local" or "managed") the changes are for. - */ - addListener(callback: (changes: { [key: string]: StorageChange }, areaName: string) => void): void; - } + interface StorageChangedEvent extends chrome.events.Event { + /** + * @param callback + * Parameter changes: Object mapping each key that changed to its corresponding storage.StorageChange for that item. + * Parameter areaName: Since Chrome 22. The name of the storage area ("sync", "local" or "managed") the changes are for. + */ + addListener(callback: (changes: { [key: string]: StorageChange }, areaName: string) => void): void; + } - /** Items in the local storage area are local to each machine. */ - var local: LocalStorageArea; - /** Items in the sync storage area are synced using Chrome Sync. */ - var sync: SyncStorageArea; + /** Items in the local storage area are local to each machine. */ + var local: LocalStorageArea; + /** Items in the sync storage area are synced using Chrome Sync. */ + var sync: SyncStorageArea; - /** - * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. - * @since Chrome 33. - */ - var managed: StorageArea; + /** + * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. + * @since Chrome 33. + */ + var managed: StorageArea; - /** Fired when one or more items change. */ - var onChanged: StorageChangedEvent; + /** Fired when one or more items change. */ + var onChanged: StorageChangedEvent; } //////////////////// From 791ab3bf260e1626ff7fa4df5eb1bda93ae03faa Mon Sep 17 00:00:00 2001 From: Nina Chaubal Date: Sat, 5 Dec 2015 21:23:17 -0600 Subject: [PATCH 086/134] FirebaseQuery.equalTo can take boolean values. See https://www.firebase.com/docs/web/api/query/equalto.html --- firebase/firebase.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/firebase/firebase.d.ts b/firebase/firebase.d.ts index df792c713..744411ab2 100644 --- a/firebase/firebase.d.ts +++ b/firebase/firebase.d.ts @@ -143,6 +143,7 @@ interface FirebaseQuery { */ equalTo(value: string, key?: string): FirebaseQuery; equalTo(value: number, key?: string): FirebaseQuery; + equalTo(value: boolean, key?: string): FirebaseQuery; /** * Generates a new Query object limited to the first certain number of children. */ From 01efb63365676e6db39bdc7b3891121b172b6b45 Mon Sep 17 00:00:00 2001 From: sodatea Date: Sun, 29 Nov 2015 01:27:37 +0800 Subject: [PATCH 087/134] Update tape.d.ts for tape v4.2.2 --- tape/tape-tests.ts | 2 +- tape/tape.d.ts | 63 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 53 insertions(+), 12 deletions(-) diff --git a/tape/tape-tests.ts b/tape/tape-tests.ts index 85bb19a6e..919da3880 100644 --- a/tape/tape-tests.ts +++ b/tape/tape-tests.ts @@ -2,7 +2,7 @@ /// -import tape = require('tape'); +import tape = require("tape"); var name: string; var cb: tape.TestCase; diff --git a/tape/tape.d.ts b/tape/tape.d.ts index 4746e148a..39ab43176 100644 --- a/tape/tape.d.ts +++ b/tape/tape.d.ts @@ -1,6 +1,6 @@ -// Type definitions for tape v2.12.3 +// Type definitions for tape v4.2.2 // Project: https://github.com/substack/tape -// Definitions by: Bart van der Schoor +// Definitions by: Bart van der Schoor , Haoqun Jiang // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -9,22 +9,43 @@ declare module 'tape' { export = tape; /** - * Create a new test with an optional name string. cb(t) fires with the new test object t once all preceeding tests have finished. Tests execute serially. + * Create a new test with an optional name string and optional opts object. + * cb(t) fires with the new test object t once all preceeding tests have finished. + * Tests execute serially. */ function tape(name: string, cb: tape.TestCase): void; + function tape(name: string, opts: tape.TestOptions, cb: tape.TestCase): void; + function tape(cb: tape.TestCase): void; + function tape(opts: tape.TestOptions, cb: tape.TestCase): void; + module tape { interface TestCase { (test: Test): void; } + /** + * Available opts options for the tape function. + */ + interface TestOptions { + skip?: boolean; // See tape.skip. + timeout?: number; // Set a timeout for the test, after which it will fail. See tape.timeoutAfter. + } + + /** + * Options for the createStream function. + */ + interface StreamOptions { + objectMode?: boolean; + } + /** * Generate a new test that will be skipped over. */ export function skip(name: string, cb: tape.TestCase): void; /** - * Like test(name, cb) except if you use .only this is the only test case that will run for the entire process, all other test cases using tape will be ignored + * Like test(name, cb) except if you use .only this is the only test case that will run for the entire process, all other test cases using tape will be ignored. */ export function only(name: string, cb: tape.TestCase): void; @@ -34,24 +55,29 @@ declare module 'tape' { export function createHarness(): typeof tape; /** * Create a stream of output, bypassing the default output stream that writes messages to console.log(). + * By default stream will be a text stream of TAP output, but you can get an object stream instead by setting opts.objectMode to true. */ - export function createStream(opts?: any): NodeJS.ReadableStream; + export function createStream(opts?: tape.StreamOptions): NodeJS.ReadableStream; interface Test { /** - * Create a subtest with a new test handle st from cb(st) inside the current test cb(st) will only fire when t finishes. Additional tests queued up after t will not be run until all subtests finish. + * Create a subtest with a new test handle st from cb(st) inside the current test. + * cb(st) will only fire when t finishes. + * Additional tests queued up after t will not be run until all subtests finish. */ test(name: string, cb: tape.TestCase): void; /** - * Declare that n assertions should be run. end() will be called automatically after the nth assertion. If there are any more assertions after the nth, or after end() is called, they will generate errors. + * Declare that n assertions should be run. end() will be called automatically after the nth assertion. + * If there are any more assertions after the nth, or after end() is called, they will generate errors. */ plan(n: number): void; /** * Declare the end of a test explicitly. + * If err is passed in t.end will assert that it is falsey. */ - end(): void; + end(err?: any): void; /** * Generate a failing assertion with a message msg. @@ -63,6 +89,11 @@ declare module 'tape' { */ pass(msg?: string): void; + /** + * Automatically timeout the test after X ms. + */ + timeoutAfter(ms: number): void; + /** * Generate an assertion that will be skipped over. */ @@ -83,7 +114,8 @@ declare module 'tape' { notok(value: any, msg?: string): void; /** - * Assert that err is falsy. If err is non-falsy, use its err.message as the description message. + * Assert that err is falsy. + * If err is non-falsy, use its err.message as the description message. */ error(err: any, msg?: string): void; ifError(err: any, msg?: string): void; @@ -149,13 +181,22 @@ declare module 'tape' { /** * Assert that the function call fn() throws an exception. + * expected, if present, must be a RegExp or Function, which is used to test the exception object. */ - throws(fn: () => void, expected: any, msg?: string): void; + throws(fn: () => void, msg?: string): void; + throws(fn: () => void, exceptionExpected: RegExp | (() => void), msg?: string): void; /** * Assert that the function call fn() does not throw an exception. */ - doesNotThrow(fn: () => void, expected: any, msg?: string): void; + doesNotThrow(fn: () => void, msg?: string): void; + doesNotThrow(fn: () => void, exceptionExpected: RegExp | (() => void), msg?: string): void; + + /** + * Print a message without breaking the tap output. + * (Useful when using e.g. tap-colorize where output is buffered & console.log will print in incorrect order vis-a-vis tap output.) + */ + comment(msg: string): void; } } } From 8d8abe471b822ec9d84fd3c8c221f3288ae2e773 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sun, 6 Dec 2015 14:43:21 +0500 Subject: [PATCH 088/134] lodash: signatures of _.negate have been changed --- lodash/lodash-tests.ts | 41 +++++++++++++++++++++++++++++++---------- lodash/lodash.d.ts | 13 +++++++++++++ 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 9cae2a872..6cc720503 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -4925,17 +4925,38 @@ module TestModArgs { } // _.negate -interface TestNegatePredicate { - (a1: number, a2: number): boolean; +module TestNegate { + interface PredicateFn { + (a1: number, a2: number): boolean; + } + + interface ResultFn { + (a1: number, a2: number): boolean; + } + + var predicate = (a1: number, a2: number) => a1 > a2; + + { + let result: ResultFn; + + result = _.negate(predicate); + result = _.negate(predicate); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _(predicate).negate(); + result = _(predicate).negate(); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _(predicate).chain().negate(); + result = _(predicate).chain().negate(); + } } -interface TestNegateResult { - (a1: number, a2: number): boolean; -} -var testNegatePredicate = (a1: number, a2: number) => a1 > a2; -result = _.negate(testNegatePredicate); -result = _.negate(testNegatePredicate); -result = _(testNegatePredicate).negate().value(); -result = _(testNegatePredicate).negate().value(); // _.once module TestOnce { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index ed8d72443..66e49e5f5 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -8462,6 +8462,7 @@ declare module _ { /** * Creates a function that negates the result of the predicate func. The func predicate is invoked with * the this binding and arguments of the created function. + * * @param predicate The predicate to negate. * @return Returns the new function. */ @@ -8485,6 +8486,18 @@ declare module _ { negate(): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.negate + */ + negate(): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + + /** + * @see _.negate + */ + negate(): LoDashExplicitObjectWrapper; + } + //_.once interface LoDashStatic { /** From 8ca6bc3f619666c4a56bf1b5db54851ddcb24f9e Mon Sep 17 00:00:00 2001 From: rhysd Date: Sun, 6 Dec 2015 22:54:48 +0900 Subject: [PATCH 089/134] Add type definitions of shuffle-array package --- shuffle-array/shuffle-array-tests.ts | 20 +++++++++++++ shuffle-array/shuffle-array.d.ts | 42 ++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 shuffle-array/shuffle-array-tests.ts create mode 100644 shuffle-array/shuffle-array.d.ts diff --git a/shuffle-array/shuffle-array-tests.ts b/shuffle-array/shuffle-array-tests.ts new file mode 100644 index 000000000..9b799bb6e --- /dev/null +++ b/shuffle-array/shuffle-array-tests.ts @@ -0,0 +1,20 @@ +/// + +import shuffle = require('shuffle-array'); + +// shuffle() +var a = [1, 2, 3, 4, 5]; +var result: number[]; +result = shuffle(a); +result = shuffle(a, {}); +result = shuffle(a, {copy: true}); +result = shuffle(a, {rng: () => 0}); +result = shuffle(a, {copy: true, rng: () => 0}); + +var b = ['aaa', 'bbb', 'ccc'] +var result2: string[]; +result2 = shuffle.pick(b); +result2 = shuffle.pick(b, {}); +result2 = shuffle.pick(b, {picks: 3}); +result2 = shuffle.pick(b, {rng: () => 0}); +result2 = shuffle.pick(b, {picks: 3, rng: () => 0}); diff --git a/shuffle-array/shuffle-array.d.ts b/shuffle-array/shuffle-array.d.ts new file mode 100644 index 000000000..880396c4a --- /dev/null +++ b/shuffle-array/shuffle-array.d.ts @@ -0,0 +1,42 @@ +// Type definitions for shuffle-array +// Project: https://github.com/pazguille/shuffle-array +// Definitions by: rhysd +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "shuffle-array" { + /** + * copy - Sets if should return a shuffled copy of the given array. By default it's a falsy value. + * rng - Specifies a custom random number generator. + */ + interface ShuffleOption { + copy?: boolean; + rng?: () => number; + } + /** + * picks - Specifies how many random elements you want to pick. By default it picks 1. + * rng - Specifies a custom random number generator. + */ + interface PickOption { + picks?: number; + rng?: () => number; + } + interface ShuffleArray { + /** + * Randomizes the order of the elements in a given array. + * + * arr - The given array. + * options - Optional configuration options. + */ + (arr: T[], options?: ShuffleOption): T[]; + /** + * Pick one or more random elements from the given array. + * + * arr - The given array. + * options - Optional configuration options. + */ + pick(arr: T[], options?: Object): T[]; + } + var shuffle: ShuffleArray; + export = shuffle; +} + From 19053aa84e473fab046938bf2648cf7ee5090111 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Mon, 7 Dec 2015 04:31:43 +0500 Subject: [PATCH 090/134] lodash: signatures of _.pick have been changed --- lodash/lodash-tests.ts | 47 +++++++++++++++++++++++++++++++----------- lodash/lodash.d.ts | 31 +++++++++++++++++++++------- 2 files changed, 59 insertions(+), 19 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 9cae2a872..3ad1c37e5 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -7047,18 +7047,41 @@ module TestPairs { } // _.pick -interface TestPickFn { - (element: any, key: string, collection: any): boolean; -} -{ - let testPickFn: TestPickFn; - let result: TResult; - result = _.pick({}, 0, '1', true, [2], ['3'], [true], [4, '5', true]); - result = _.pick({}, testPickFn); - result = _.pick({}, testPickFn, any); - result = _({}).pick(0, '1', true, [2], ['3'], [true], [4, '5', true]).value(); - result = _({}).pick(testPickFn).value(); - result = _({}).pick(testPickFn, any).value(); +module TestPick { + let predicate: (element: any, key: string, collection: any) => boolean; + + { + let result: TResult; + + result = _.pick({}, 'a'); + result = _.pick({}, 0, 'a'); + result = _.pick({}, true, 0, 'a'); + result = _.pick({}, ['b', 1, false], true, 0, 'a'); + result = _.pick({}, predicate); + result = _.pick({}, predicate, any); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _({}).pick('a'); + result = _({}).pick(0, 'a'); + result = _({}).pick(true, 0, 'a'); + result = _({}).pick(['b', 1, false], true, 0, 'a'); + result = _({}).pick(predicate); + result = _({}).pick(predicate, any); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _({}).chain().pick('a'); + result = _({}).chain().pick(0, 'a'); + result = _({}).chain().pick(true, 0, 'a'); + result = _({}).chain().pick(['b', 1, false], true, 0, 'a'); + result = _({}).chain().pick(predicate); + result = _({}).chain().pick(predicate, any); + } } // _.result diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index ed8d72443..9c11aedac 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -11771,9 +11771,9 @@ declare module _ { * @param predicate The function invoked per iteration or property names to pick, specified as individual * property names or arrays of property names. * @param thisArg The this binding of predicate. - * @return An object composed of the picked properties. + * @return Returns the new object. */ - pick( + pick( object: T, predicate: ObjectIterator, thisArg?: any @@ -11782,9 +11782,9 @@ declare module _ { /** * @see _.pick */ - pick( + pick( object: T, - ...predicate: Array> + ...predicate: (StringRepresentable|StringRepresentable[])[] ): TResult; } @@ -11792,7 +11792,7 @@ declare module _ { /** * @see _.pick */ - pick( + pick( predicate: ObjectIterator, thisArg?: any ): LoDashImplicitObjectWrapper; @@ -11800,11 +11800,28 @@ declare module _ { /** * @see _.pick */ - pick( - ...predicate: Array> + pick( + ...predicate: (StringRepresentable|StringRepresentable[])[] ): LoDashImplicitObjectWrapper; } + interface LoDashExplicitObjectWrapper { + /** + * @see _.pick + */ + pick( + predicate: ObjectIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper; + + /** + * @see _.pick + */ + pick( + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): LoDashExplicitObjectWrapper; + } + //_.result interface LoDashStatic { /** From eb48b34846b3f336e02afc6facf614c6ad6f70e1 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Sun, 6 Dec 2015 20:08:00 -0600 Subject: [PATCH 091/134] Move //-comments above the corresponding line and use /** */ syntax so that TypeScript tooling will read it. Standardize formatting. --- imap/imap.d.ts | 313 +++++++++++++++++++++++++++---------------------- 1 file changed, 172 insertions(+), 141 deletions(-) diff --git a/imap/imap.d.ts b/imap/imap.d.ts index 128491955..ce9fd7223 100644 --- a/imap/imap.d.ts +++ b/imap/imap.d.ts @@ -5,32 +5,46 @@ /// - declare module IMAP { - + // The property names of these interfaces match the documentation (where type names were given). export interface Config { - user: string; // Username for plain-text authentication. - password: string; // Password for plain-text authentication. - xoauth?: string; // Base64-encoded OAuth token for OAuth authentication for servers that support it (See Andris Reinman's xoauth.js module to help generate this string). - xoauth2?: string; // Base64-encoded OAuth2 token for The SASL XOAUTH2 Mechanism for servers that support it (See Andris Reinman's xoauth2 module to help generate this string). - host?: string; // Hostname or IP address of the IMAP server. Default: "localhost" - port?: number; // Port number of the IMAP server. Default: 143 - tls?: boolean; // Perform implicit TLS connection? Default: false - tlsOptions?: Object; // Options object to pass to tls.connect() Default: (none) - autotls?: string; // Set to 'always' to always attempt connection upgrades via STARTTLS, 'required' only if upgrading is required, or 'never' to never attempt upgrading. Default: 'never' - connTimeout?: number; // Number of milliseconds to wait for a connection to be established. Default: 10000 - authTimeout?: number; // Number of milliseconds to wait to be authenticated after a connection has been established. Default: 5000 - keepalive?: any; /* boolean|KeepAlive */ // Configures the keepalive mechanism. Set to true to enable keepalive with defaults or set to object to enable and configure keepalive behavior: Default: true - debug?: Function; // If set, the function will be called with one argument, a string containing some debug info Default: (no debug output) + /** Username for plain-text authentication. */ + user: string; + /** Password for plain-text authentication. */ + password: string; + /** Base64-encoded OAuth token for OAuth authentication for servers that support it (See Andris Reinman's xoauth.js module to help generate this string). */ + xoauth?: string; + /** Base64-encoded OAuth2 token for The SASL XOAUTH2 Mechanism for servers that support it (See Andris Reinman's xoauth2 module to help generate this string). */ + xoauth2?: string; + /** Hostname or IP address of the IMAP server. Default: "localhost" */ + host?: string; + /** Port number of the IMAP server. Default: 143 */ + port?: number; + /** Perform implicit TLS connection? Default: false */ + tls?: boolean; + /** Options object to pass to tls.connect() Default: (none) */ + tlsOptions?: Object; + /** Set to 'always' to always attempt connection upgrades via STARTTLS, 'required' only if upgrading is required, or 'never' to never attempt upgrading. Default: 'never' */ + autotls?: string; + /** Number of milliseconds to wait for a connection to be established. Default: 10000 */ + connTimeout?: number; + /** Number of milliseconds to wait to be authenticated after a connection has been established. Default: 5000 */ + authTimeout?: number; + /** Configures the keepalive mechanism. Set to true to enable keepalive with defaults or set to object to enable and configure keepalive behavior: Default: true */ + keepalive?: any; /* boolean|KeepAlive */ + /** If set, the function will be called with one argument, a string containing some debug info Default: (no debug output) */ + debug?: Function; } - export interface KeepAlive { - interval?: number; // This is the interval (in milliseconds) at which NOOPs are sent and the interval at which idleInterval is checked. Default: 10000 - idleInterval?: number; // This is the interval (in milliseconds) at which an IDLE command (for servers that support IDLE) is re-sent. Default: 300000 (5 mins) - forceNoop?: boolean; // Set to true to force use of NOOP keepalive on servers also support IDLE. Default: false + /** This is the interval (in milliseconds) at which NOOPs are sent and the interval at which idleInterval is checked. Default: 10000 */ + interval?: number; + /** This is the interval (in milliseconds) at which an IDLE command (for servers that support IDLE) is re-sent. Default: 300000 (5 mins) */ + idleInterval?: number; + /** Set to true to force use of NOOP keepalive on servers also support IDLE. Default: false */ + forceNoop?: boolean; } // One of: @@ -41,63 +55,78 @@ declare module IMAP { // type MessageSource = string | string[] - - - export interface Box { - name: string; // The name of this mailbox. - readOnly?: boolean; // True if this mailbox was opened in read-only mode. (Only available with openBox() calls) - newKeywords: boolean; //True if new keywords can be added to messages in this mailbox. - uidvalidity: number; // A 32-bit number that can be used to determine if UIDs in this mailbox have changed since the last time this mailbox was opened. - uidnext: number; // The uid that will be assigned to the next message that arrives at this mailbox. - flags: string[]; // array - A list of system-defined flags applicable for this mailbox. Flags in this list but not in permFlags may be stored for the current session only. Additional server implementation-specific flags may also be available. - permFlags: string[]; // A list of flags that can be permanently added/removed to/from messages in this mailbox. - persistentUIDs: boolean; // Whether or not this mailbox has persistent UIDs. This should almost always be true for modern mailboxes and should only be false for legacy mail stores where supporting persistent UIDs was not technically feasible. - messages: { //Contains various message counts for this mailbox: - total: number; // Total number of messages in this mailbox. - new: number; // Number of messages in this mailbox having the Recent flag (this IMAP session is the first to see these messages). - unseen: number; // (Only available with status() calls) Number of messages in this mailbox not having the Seen flag (marked as not having been read). + /** The name of this mailbox. */ + name: string; + /** True if this mailbox was opened in read-only mode. (Only available with openBox() calls) */ + readOnly?: boolean; + /** True if new keywords can be added to messages in this mailbox. */ + newKeywords: boolean; + /** A 32-bit number that can be used to determine if UIDs in this mailbox have changed since the last time this mailbox was opened. */ + uidvalidity: number; + /** The uid that will be assigned to the next message that arrives at this mailbox. */ + uidnext: number; + /** array - A list of system-defined flags applicable for this mailbox. Flags in this list but not in permFlags may be stored for the current session only. Additional server implementation-specific flags may also be available. */ + flags: string[]; + /** A list of flags that can be permanently added/removed to/from messages in this mailbox. */ + permFlags: string[]; + /** Whether or not this mailbox has persistent UIDs. This should almost always be true for modern mailboxes and should only be false for legacy mail stores where supporting persistent UIDs was not technically feasible. */ + persistentUIDs: boolean; + /** Contains various message counts for this mailbox: */ + messages: { + /** Total number of messages in this mailbox. */ + total: number; + /** Number of messages in this mailbox having the Recent flag (this IMAP session is the first to see these messages). */ + new: number; + /** (Only available with status() calls) Number of messages in this mailbox not having the Seen flag (marked as not having been read). */ + unseen: number; }; } - // Given in a 'message' event from ImapFetch - export interface ImapMessage extends NodeJS.EventEmitter { - } - + /** Given in a 'message' event from ImapFetch */ + export interface ImapMessage extends NodeJS.EventEmitter { } export interface FetchOptions { - markSeen?: boolean; // Mark message(s) as read when fetched. Default: false - struct?: boolean; // Fetch the message structure. Default: false - envelope?: boolean; // Fetch the message envelope. Default: false - size?: boolean; // Fetch the RFC822 size. Default: false - modifiers?: Object; // Fetch modifiers defined by IMAP extensions. Default: (none) - bodies?: any; /* string|string[] */ // A string or Array of strings containing the body part section to fetch. Default: (none) Example sections: + /** Mark message(s) as read when fetched. Default: false */ + markSeen?: boolean; + /** Fetch the message structure. Default: false */ + struct?: boolean; + /** Fetch the message envelope. Default: false */ + envelope?: boolean; + /** Fetch the RFC822 size. Default: false */ + size?: boolean; + /** Fetch modifiers defined by IMAP extensions. Default: (none) */ + modifiers?: Object; + /** A string or Array of strings containing the body part section to fetch. Default: (none) Example sections: */ + bodies?: any; /* string|string[] */ } - // Returned from fetch() - export interface ImapFetch extends NodeJS.EventEmitter { - } - + /** Returned from fetch() */ + export interface ImapFetch extends NodeJS.EventEmitter { } + export interface Folder { - attribs: string[]; - delimiter: string; - children: Folder[]; - parent: Folder; + attribs: string[]; + delimiter: string; + children: Folder[]; + parent: Folder; } export interface MailBoxes { - [name: string] : Folder; + [name: string]: Folder; } export interface AppendOptions { - mailbox?: string; // The name of the mailbox to append the message to. Default: the currently open mailbox - flags?: any; /* string|string[] */ // A single flag (e.g. 'Seen') or an array of flags (e.g. ['Seen', 'Flagged']) to append to the message. Default: (no flags) - date?: Date; // What to use for message arrival date/time. Default: (current date/time) + /** The name of the mailbox to append the message to. Default: the currently open mailbox */ + mailbox?: string; + /** A single flag (e.g. 'Seen') or an array of flags (e.g. ['Seen', 'Flagged']) to append to the message. Default: (no flags) */ + flags?: any; /* string|string[] */ + /** What to use for message arrival date/time. Default: (current date/time) */ + date?: Date; } @@ -118,7 +147,7 @@ declare module IMAP { UNDRAFT: void; // Messages that do not have the Draft flag set. UNFLAGGED: void; // Messages that do not have the Flagged flag set. UNSEEN: void; // Messages that do not have the Seen flag set. - + // The following are valid types that require string value(s): BCC: any; // Messages that contain the specified string in the BCC field. @@ -146,28 +175,28 @@ declare module IMAP { export interface MessageFunctions { - // Searches the currently open mailbox for messages using given criteria. criteria is a list describing what you want to find. For criteria types that require arguments, use an array instead of just the string criteria type name (e.g. ['FROM', 'foo@bar.com']). Prefix criteria types with an "!" to negate. - search(criteria : any[], callback : (error : Error, uids : string[]) => void) : void; - // Fetches message(s) in the currently open mailbox. - fetch(source : any /* MessageSource */, options : FetchOptions) : ImapFetch; - // Copies message(s) in the currently open mailbox to another mailbox. - copy(source : any /* MessageSource */, mailboxName : string, callback : (error : Error) => void) : void; - // Moves message(s) in the currently open mailbox to another mailbox. Note: The message(s) in the destination mailbox will have a new message UID. - move(source : any /* MessageSource */, mailboxName : string, callback : (error : Error) => void) : void; - // Adds flag(s) to message(s). - addFlags(source : any /* MessageSource */, flags : any, callback : (error : Error) => void) : void; - // Removes flag(s) from message(s). - delFlags(source : any /* MessageSource */, flags : any, callback : (error : Error) => void) : void; - // Sets the flag(s) for message(s). - setFlags(source : any /* MessageSource */, flags : any, callback : (error : Error) => void) : void; - // Adds keyword(s) to message(s). keywords is either a single keyword or an array of keywords. - addKeywords(source : any /* MessageSource */, keywords : any /* string|string[] */, callback : (error : Error) => void) : void; - //Removes keyword(s) from message(s). keywords is either a single keyword or an array of keywords. - delKeywords(source : any /* MessageSource */, keywords : any /* string|string[] */, callback : (error : Error) => void) : void; - // Sets keyword(s) for message(s). keywords is either a single keyword or an array of keywords. - setKeywords(source : any /* MessageSource */, keywords : any /* string|string[] */, callback : (error : Error) => void) : void; - // Checks if the server supports the specified capability. - serverSupports(capability : string) : boolean; + /** Searches the currently open mailbox for messages using given criteria. criteria is a list describing what you want to find. For criteria types that require arguments, use an array instead of just the string criteria type name (e.g. ['FROM', 'foo@bar.com']). Prefix criteria types with an "!" to negate. */ + search(criteria: any[], callback: (error: Error, uids: string[]) => void): void; + /** Fetches message(s) in the currently open mailbox. */ + fetch(source: any /* MessageSource */, options: FetchOptions): ImapFetch; + /** Copies message(s) in the currently open mailbox to another mailbox. */ + copy(source: any /* MessageSource */, mailboxName: string, callback: (error: Error) => void): void; + /** Moves message(s) in the currently open mailbox to another mailbox. Note: The message(s) in the destination mailbox will have a new message UID. */ + move(source: any /* MessageSource */, mailboxName: string, callback: (error: Error) => void): void; + /** Adds flag(s) to message(s). */ + addFlags(source: any /* MessageSource */, flags: any, callback: (error: Error) => void): void; + /** Removes flag(s) from message(s). */ + delFlags(source: any /* MessageSource */, flags: any, callback: (error: Error) => void): void; + /** Sets the flag(s) for message(s). */ + setFlags(source: any /* MessageSource */, flags: any, callback: (error: Error) => void): void; + /** Adds keyword(s) to message(s). keywords is either a single keyword or an array of keywords. */ + addKeywords(source: any /* MessageSource */, keywords: any /* string|string[] */, callback: (error: Error) => void): void; + /** Removes keyword(s) from message(s). keywords is either a single keyword or an array of keywords. */ + delKeywords(source: any /* MessageSource */, keywords: any /* string|string[] */, callback: (error: Error) => void): void; + /** Sets keyword(s) for message(s). keywords is either a single keyword or an array of keywords. */ + setKeywords(source: any /* MessageSource */, keywords: any /* string|string[] */, callback: (error: Error) => void): void; + /** Checks if the server supports the specified capability. */ + serverSupports(capability: string): boolean; } @@ -175,8 +204,8 @@ declare module IMAP { export class Connection implements NodeJS.EventEmitter, MessageFunctions { /** @constructor */ - constructor(config : Config); - + constructor(config: Config); + // from NodeJS.EventEmitter addListener(event: string, listener: Function): NodeJS.EventEmitter; on(event: string, listener: Function): NodeJS.EventEmitter; @@ -186,87 +215,89 @@ declare module IMAP { setMaxListeners(n: number): void; listeners(event: string): Function[]; emit(event: string, ...args: any[]): boolean; - + // from MessageFunctions - // Searches the currently open mailbox for messages using given criteria. criteria is a list describing what you want to find. For criteria types that require arguments, use an array instead of just the string criteria type name (e.g. ['FROM', 'foo@bar.com']). Prefix criteria types with an "!" to negate. - search(criteria : any[], callback : (error : Error, uids : string[]) => void) : void; - // Fetches message(s) in the currently open mailbox. - fetch(source : any /* MessageSource */, options : FetchOptions) : ImapFetch; - // Copies message(s) in the currently open mailbox to another mailbox. - copy(source : any /* MessageSource */, mailboxName : string, callback : (error : Error) => void) : void; - // Moves message(s) in the currently open mailbox to another mailbox. Note: The message(s) in the destination mailbox will have a new message UID. - move(source : any /* MessageSource */, mailboxName : string, callback : (error : Error) => void) : void; - // Adds flag(s) to message(s). - addFlags(source : any /* MessageSource */, flags : any, callback : (error : Error) => void) : void; - // Removes flag(s) from message(s). - delFlags(source : any /* MessageSource */, flags : any, callback : (error : Error) => void) : void; - // Sets the flag(s) for message(s). - setFlags(source : any /* MessageSource */, flags : any, callback : (error : Error) => void) : void; - // Adds keyword(s) to message(s). keywords is either a single keyword or an array of keywords. - addKeywords(source : any /* MessageSource */, keywords : any /* string|string[] */, callback : (error : Error) => void) : void; - //Removes keyword(s) from message(s). keywords is either a single keyword or an array of keywords. - delKeywords(source : any /* MessageSource */, keywords : any /* string|string[] */, callback : (error : Error) => void) : void; - // Sets keyword(s) for message(s). keywords is either a single keyword or an array of keywords. - setKeywords(source : any /* MessageSource */, keywords : any /* string|string[] */, callback : (error : Error) => void) : void; - // Checks if the server supports the specified capability. - serverSupports(capability : string) : boolean; - - // Parses a raw header and returns an object keyed on header fields and the values are Arrays of header field values. Set disableAutoDecode to true to disable automatic decoding of MIME encoded-words that may exist in header field values. - static parseHeader(rawHeader: string, disableAutoDecode? : boolean) : any; - - state: string; // The current state of the connection (e.g. 'disconnected', 'connected', 'authenticated'). - delimiter: string; // The (top-level) mailbox hierarchy delimiter. If the server does not support mailbox hierarchies and only a flat list, this value will be falsey. - namespaces: { // Contains information about each namespace type (if supported by the server) with the following properties: - personal: any[]; // Mailboxes that belong to the logged in user. - other: any[]; // Mailboxes that belong to other users that the logged in user has access to. - shared: any[]; // Mailboxes that are accessible by any logged in user. + /** Searches the currently open mailbox for messages using given criteria. criteria is a list describing what you want to find. For criteria types that require arguments, use an array instead of just the string criteria type name (e.g. ['FROM', 'foo@bar.com']). Prefix criteria types with an "!" to negate. */ + search(criteria: any[], callback: (error: Error, uids: string[]) => void): void; + /** Fetches message(s) in the currently open mailbox. */ + fetch(source: any /* MessageSource */, options: FetchOptions): ImapFetch; + /** Copies message(s) in the currently open mailbox to another mailbox. */ + copy(source: any /* MessageSource */, mailboxName: string, callback: (error: Error) => void): void; + /** Moves message(s) in the currently open mailbox to another mailbox. Note: The message(s) in the destination mailbox will have a new message UID. */ + move(source: any /* MessageSource */, mailboxName: string, callback: (error: Error) => void): void; + /** Adds flag(s) to message(s). */ + addFlags(source: any /* MessageSource */, flags: any, callback: (error: Error) => void): void; + /** Removes flag(s) from message(s). */ + delFlags(source: any /* MessageSource */, flags: any, callback: (error: Error) => void): void; + /** Sets the flag(s) for message(s). */ + setFlags(source: any /* MessageSource */, flags: any, callback: (error: Error) => void): void; + /** Adds keyword(s) to message(s). keywords is either a single keyword or an array of keywords. */ + addKeywords(source: any /* MessageSource */, keywords: any /* string|string[] */, callback: (error: Error) => void): void; + /** Removes keyword(s) from message(s). keywords is either a single keyword or an array of keywords. */ + delKeywords(source: any /* MessageSource */, keywords: any /* string|string[] */, callback: (error: Error) => void): void; + /** Sets keyword(s) for message(s). keywords is either a single keyword or an array of keywords. */ + setKeywords(source: any /* MessageSource */, keywords: any /* string|string[] */, callback: (error: Error) => void): void; + /** Checks if the server supports the specified capability. */ + serverSupports(capability: string): boolean; + + /** Parses a raw header and returns an object keyed on header fields and the values are Arrays of header field values. Set disableAutoDecode to true to disable automatic decoding of MIME encoded-words that may exist in header field values. */ + static parseHeader(rawHeader: string, disableAutoDecode?: boolean): any; + + /** The current state of the connection (e.g. 'disconnected', 'connected', 'authenticated'). */ + state: string; + /** The (top-level) mailbox hierarchy delimiter. If the server does not support mailbox hierarchies and only a flat list, this value will be falsey. */ + delimiter: string; + /** Contains information about each namespace type (if supported by the server) with the following properties: */ + namespaces: { + /** Mailboxes that belong to the logged in user. */ + personal: any[]; + /** Mailboxes that belong to other users that the logged in user has access to. */ + other: any[]; + /** Mailboxes that are accessible by any logged in user. */ + shared: any[]; }; seq: MessageFunctions; /** Attempts to connect and authenticate with the IMAP server. */ - connect() : void; + connect(): void; /** Closes the connection to the server after all requests in the queue have been sent. */ - end() : void; + end(): void; /** Immediately destroys the connection to the server. */ - destroy() : void; + destroy(): void; /** Opens a specific mailbox that exists on the server. mailboxName should include any necessary prefix/path. modifiers is used by IMAP extensions. */ - openBox(mailboxName : string, callback : (error : Error, mailbox: Box) => void) : void; - openBox(mailboxName : string, openReadOnly : boolean, callback : (error : Error, mailbox: Box) => void) : void; - openBox(mailboxName : string, openReadOnly : boolean, modifiers : Object, callback : (error : Error, mailbox: Box) => void) : void; + openBox(mailboxName: string, callback: (error: Error, mailbox: Box) => void): void; + openBox(mailboxName: string, openReadOnly: boolean, callback: (error: Error, mailbox: Box) => void): void; + openBox(mailboxName: string, openReadOnly: boolean, modifiers: Object, callback: (error: Error, mailbox: Box) => void): void; /** Closes the currently open mailbox. If autoExpunge is true, any messages marked as Deleted in the currently open mailbox will be removed if the mailbox was NOT opened in read-only mode. If autoExpunge is false, you disconnect, or you open another mailbox, messages marked as Deleted will NOT be removed from the currently open mailbox. */ - closeBox(callback : (error : Error) => void) : void; - closeBox(autoExpunge : boolean, callback : (error : Error) => void) : void; + closeBox(callback: (error: Error) => void): void; + closeBox(autoExpunge: boolean, callback: (error: Error) => void): void; /** Creates a new mailbox on the server. mailboxName should include any necessary prefix/path. */ - addBox(mailboxName : string, callback : (error : Error) => void) : void; + addBox(mailboxName: string, callback: (error: Error) => void): void; /** Removes a specific mailbox that exists on the server. mailboxName should including any necessary prefix/path. */ - delBox(mailboxName : string, callback : (error : Error, uids : string[]) => void) : void; + delBox(mailboxName: string, callback: (error: Error, uids: string[]) => void): void; /** Renames a specific mailbox that exists on the server. Both oldMailboxName and newMailboxName should include any necessary prefix/path. Note: Renaming the 'INBOX' mailbox will instead cause all messages in 'INBOX' to be moved to the new mailbox. */ - renameBox(oldMailboxName : string, newMailboxName : string, callback : (error : Error, mailbox: Box) => void) : void; + renameBox(oldMailboxName: string, newMailboxName: string, callback: (error: Error, mailbox: Box) => void): void; /** Subscribes to a specific mailbox that exists on the server. mailboxName should include any necessary prefix/path. */ - subscribeBox(mailboxName : string, callback : (error : Error) => void) : void; + subscribeBox(mailboxName: string, callback: (error: Error) => void): void; /** Unsubscribes from a specific mailbox that exists on the server. mailboxName should include any necessary prefix/path. */ - unsubscribeBox(mailboxName : string, callback : (error : Error) => void) : void; + unsubscribeBox(mailboxName: string, callback: (error: Error) => void): void; /** Fetches information about a mailbox other than the one currently open. Note: There is no guarantee that this will be a fast operation on the server. Also, do not call this on the currently open mailbox. */ - status(mailboxName : string, callback : (error : Error, mailbox: Box) => void) : void; + status(mailboxName: string, callback: (error: Error, mailbox: Box) => void): void; /** Obtains the full list of mailboxes. If nsPrefix is not specified, the main personal namespace is used. */ - getBoxes(callback : (error : Error, mailboxes: MailBoxes) => void) : void; - getBoxes(nsPrefix : string, callback : (error : Error, mailboxes: MailBoxes) => void) : void; + getBoxes(callback: (error: Error, mailboxes: MailBoxes) => void): void; + getBoxes(nsPrefix: string, callback: (error: Error, mailboxes: MailBoxes) => void): void; /** Obtains the full list of subscribed mailboxes. If nsPrefix is not specified, the main personal namespace is used. */ - getSubscribedBoxes(callback : (error : Error, mailboxes: MailBoxes) => void) : void; - getSubscribedBoxes(nsPrefix : string, callback : (error : Error, mailboxes: MailBoxes) => void) : void; + getSubscribedBoxes(callback: (error: Error, mailboxes: MailBoxes) => void): void; + getSubscribedBoxes(nsPrefix: string, callback: (error: Error, mailboxes: MailBoxes) => void): void; /** Permanently removes all messages flagged as Deleted in the currently open mailbox. If the server supports the 'UIDPLUS' capability, uids can be supplied to only remove messages that both have their uid in uids and have the \Deleted flag set. Note: At least on Gmail, performing this operation with any currently open mailbox that is not the Spam or Trash mailbox will merely archive any messages marked as Deleted (by moving them to the 'All Mail' mailbox). */ - expunge(callback : (error : Error) => void) : void; - expunge(uids : any /* MessageSource */, callback : (error : Error) => void) : void; - // Appends a message to selected mailbox. msgData is a string or Buffer containing an RFC-822 compatible MIME message. Valid options properties are: - append(msgData : any, callback : (error : Error) => void) : void; - append(msgData : any, options : AppendOptions, callback : (error : Error) => void) : void; + expunge(callback: (error: Error) => void): void; + expunge(uids: any /* MessageSource */, callback: (error: Error) => void): void; + /** Appends a message to selected mailbox. msgData is a string or Buffer containing an RFC-822 compatible MIME message. Valid options properties are: */ + append(msgData: any, callback: (error: Error) => void): void; + append(msgData: any, options: AppendOptions, callback: (error: Error) => void): void; } - } - declare module "imap" { - var out: typeof IMAP.Connection; - export = out; } From ec0ee97259280fa893398c61688ad031c9de77a6 Mon Sep 17 00:00:00 2001 From: Jacob Eggers Date: Sun, 6 Dec 2015 21:58:46 -0800 Subject: [PATCH 092/134] Fixing rx-lite module name --- rx/rx.lite.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rx/rx.lite.d.ts b/rx/rx.lite.d.ts index 66ec67849..6192f13ca 100644 --- a/rx/rx.lite.d.ts +++ b/rx/rx.lite.d.ts @@ -10,6 +10,6 @@ /// /// -declare module "rx.lite" { +declare module "rx-lite" { export = Rx; } From 7f14ac023aee0836218cc32278882de14559372a Mon Sep 17 00:00:00 2001 From: Dave Keen Date: Mon, 7 Dec 2015 12:28:15 +0100 Subject: [PATCH 093/134] strokeMiterlimit was left out of the React 0.14 typings --- react/react.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/react/react.d.ts b/react/react.d.ts index fb04cf0f5..bd3581111 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -1864,6 +1864,7 @@ declare namespace __React { stroke?: string; strokeDasharray?: string; strokeLinecap?: string; + strokeMiterlimit?: string; strokeOpacity?: number | string; strokeWidth?: number | string; textAnchor?: string; From e120044c7b8821d0da3aba2e18c4494e99688cdb Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Mon, 7 Dec 2015 14:57:49 +0100 Subject: [PATCH 094/134] Update README build status badge to correct URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 82833752d..7e1d60d87 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# DefinitelyTyped [![Build Status](https://travis-ci.org/borisyankov/DefinitelyTyped.png?branch=master)](https://travis-ci.org/borisyankov/DefinitelyTyped) +# DefinitelyTyped [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.png?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) [![Join the chat at https://gitter.im/borisyankov/DefinitelyTyped](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) From caa3cf3634551dfa745272e02dcdb78bce83a329 Mon Sep 17 00:00:00 2001 From: Lars Michaelis Date: Mon, 7 Dec 2015 16:21:26 +0100 Subject: [PATCH 095/134] rename folder from jsf to jee-jsf --- {jsf => jee-jsf}/jsf-tests.ts | 0 {jsf => jee-jsf}/jsf.d.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {jsf => jee-jsf}/jsf-tests.ts (100%) rename {jsf => jee-jsf}/jsf.d.ts (100%) diff --git a/jsf/jsf-tests.ts b/jee-jsf/jsf-tests.ts similarity index 100% rename from jsf/jsf-tests.ts rename to jee-jsf/jsf-tests.ts diff --git a/jsf/jsf.d.ts b/jee-jsf/jsf.d.ts similarity index 100% rename from jsf/jsf.d.ts rename to jee-jsf/jsf.d.ts From 1c3380ab16cd81b52c3ad8b50cf97da60ab26066 Mon Sep 17 00:00:00 2001 From: David Broder-Rodgers Date: Mon, 7 Dec 2015 15:11:58 +0000 Subject: [PATCH 096/134] Added typings for chai-things --- chai-things/chai-things-tests.ts | 59 ++++++++++++++++++++++++++++++++ chai-things/chai-things.d.ts | 55 +++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 chai-things/chai-things-tests.ts create mode 100644 chai-things/chai-things.d.ts diff --git a/chai-things/chai-things-tests.ts b/chai-things/chai-things-tests.ts new file mode 100644 index 000000000..de6a4c3ff --- /dev/null +++ b/chai-things/chai-things-tests.ts @@ -0,0 +1,59 @@ +/// + +import chai = require('chai'); +import chaiThings = require('chai-things'); + +chai.use(chaiThings); + +function test_somethingSyntax() { + [].should.not.include.something(); + [].should.not.include.something.that.equals(1); + + var array = [{ a: 1 }, { b: 2 }]; + array.should.include.something(); + array.should.include.something.that.deep.equals({ b: 2 }); + array.should.include.something.that.not.deep.equals({ b: 2 }); + array.should.not.include.something.that.deep.equals({ c: 3 }); + array.should.include.something.that.not.deep.equals({ c: 3 }); + array.should.include.something.with.property('b', 2); + array.should.not.include.something.with.property('b', 3); + + var array2 = [{ a: 'b' }, { a: 'b' }]; + array2.should.include.something.that.have.property("a"); + array2.should.include.something.that.have.property("a").not.equal("d"); +} + +function test_somethingVariantsSyntax() { + [].should.not.include.any(); + [].should.not.include.any.that.deep.equal({ b: 2 }); + + var array = [{ a: 1 }, { b: 2 }]; + array.should.include.a.thing(); + array.should.include.a.thing.that.deep.equals({ b: 2 }); + array.should.include.an.item(); + array.should.include.an.item.that.deep.equals({ b: 2 }); + array.should.include.one.that.deep.equals({ b: 2 }); + array.should.include.some(); + array.should.include.some.that.deep.equal({ b: 2 }); +} + +function test_allSyntax() { + [].should.all.equal(1); + [].should.all.not.equal(1); + + var array = [1, 1]; + array.should.all.equal(1); + array.should.all.not.equal(2); + array.should.not.all.equal(2); + array.should.not.all.not.equal(1); + + var array2 = [1, 2]; + array2.should.not.all.equal(1); + array2.should.not.all.equal(2); + array2.should.not.all.not.equal(1); + array2.should.not.all.not.equal(2); + + var array3 = [{ a: 'b' }, { a: 'c' }]; + array3.should.all.have.property("a"); + array3.should.all.have.property("a").not.equal("d"); +} \ No newline at end of file diff --git a/chai-things/chai-things.d.ts b/chai-things/chai-things.d.ts new file mode 100644 index 000000000..bc2b89c46 --- /dev/null +++ b/chai-things/chai-things.d.ts @@ -0,0 +1,55 @@ +// Type definitions for chai-things +// Project: https://github.com/chaijs/chai-things +// Definitions by: David Broder-Rodgers +// Definitions: https://github.com/DavidBR-SW/DefinitelyTyped + +/// + +declare module Chai { + interface ArrayAssertion { + include: ArrayInclude; + contain: ArrayInclude; + not: ArrayAssertion; + all: Assertion; + } + + interface ArrayInclude { + (item: any): any; + a: Item; + an: Item; + one: Something; + some: Something; + something: Something; + any: Anything; + } + + interface Anything extends Assertion { + (): any; + that: Assertion + with: Assertion + } + + interface Something extends Assertion { + (): any; + that: Assertion + with: Assertion + } + + interface Item { + item: Something; + thing: Something; + } + + interface Deep { + equals: Equal; + } +} + +interface Array { + should: Chai.ArrayAssertion; +} + +declare module "chai-things" { + function chaiThings(chai: any, utils: any): void; + export = chaiThings; +} From 7e4c025262a4af55afb8f41f6ad4451d17066cd5 Mon Sep 17 00:00:00 2001 From: Calvin Fernandez Date: Sat, 5 Dec 2015 14:25:01 -0500 Subject: [PATCH 097/134] Add typings to support angular ui tree callbacks --- angular-ui-tree/angular-ui-tree-tests.ts | 69 ++++++++++++++++++++++++ angular-ui-tree/angular-ui-tree.d.ts | 64 ++++++++++++++++++++++ 2 files changed, 133 insertions(+) diff --git a/angular-ui-tree/angular-ui-tree-tests.ts b/angular-ui-tree/angular-ui-tree-tests.ts index e66408814..4e5ef91b9 100644 --- a/angular-ui-tree/angular-ui-tree-tests.ts +++ b/angular-ui-tree/angular-ui-tree-tests.ts @@ -11,3 +11,72 @@ var treeNode2: AngularUITree.ITreeNode = { nodes: [treeNode], title: "test2" }; + +// fake jquery node here so that we can pull a pretend +// angular scope element out of it +var dummyJQueryNode: ng.IAugmentedJQuery; +var fakeScope: (ng.IScope | AngularUITree.IParentTreeNodeScope) = dummyJQueryNode.scope(); + +( fakeScope).node = treeNode; + +var treeNodeScope: AngularUITree.ITreeNodeScope = fakeScope; + +( fakeScope).isParent = (nodeScope: AngularUITree.ITreeNodeScope) => { + return true; +}; + +var parentTreeNodeScope: AngularUITree.IParentTreeNodeScope = fakeScope; + +var eventSourceInfo: AngularUITree.IEventSourceInfo = { + cloneModel: {}, + nodeScope: treeNodeScope, + index: 0, + nodesScope: parentTreeNodeScope +}; + +var position: AngularUITree.IPosition = { + dirAx: 0, + dirX: 0, + dirY: 0, + distAxX: 0, + distAxY: 0, + distX: 0, + distY: 0, + lastDirX: 0, + lastDirY: 0, + lastX: 0, + lastY: 0, + moving: true, + nowX: 0, + nowY: 0, + offsetX: 0, + offsetY: 0, + startX: 0, + startY: 0 + +}; + +var eventInfo: AngularUITree.IEventInfo = { + source: eventSourceInfo, + dest: { + index: 0, + nodesScope: parentTreeNodeScope + }, + elements: {}, + pos: position +}; + +var acceptCallback: AngularUITree.IAcceptCallback = (source: AngularUITree.ITreeNodeScope, + destination: AngularUITree.ITreeNodeScope, + destinationIndex: number) => { + return false; +}; + +var droppedCallback: AngularUITree.IDroppedCallback = (eventInfo: AngularUITree.IEventInfo) => { + return; +}; + +var callbacks: AngularUITree.ICallbacks = { + accept: acceptCallback, + dropped: droppedCallback +}; diff --git a/angular-ui-tree/angular-ui-tree.d.ts b/angular-ui-tree/angular-ui-tree.d.ts index 1017ac11c..62c8899fa 100644 --- a/angular-ui-tree/angular-ui-tree.d.ts +++ b/angular-ui-tree/angular-ui-tree.d.ts @@ -3,7 +3,71 @@ // Definitions by: Calvin Fernandez // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module AngularUITree { + interface IEventSourceInfo { + cloneModel: any; + index: number; + nodeScope: ITreeNodeScope; + nodesScope: ITreeNodeScope; + } + + interface IPosition { + dirAx: number; + dirX: number; + dirY: number; + distAxX: number; + distAxY: number; + distX: number; + distY: number; + lastDirX: number; + lastDirY: number; + lastX: number; + lastY: number; + moving: boolean; + nowX: number; + nowY: number; + offsetX: number; + offsetY: number; + startX: number; + startY: number; + } + + interface IEventInfo { + dest: { + index: number; + nodesScope: IParentTreeNodeScope; + }; + elements: any; + pos: IPosition; + source: IEventSourceInfo; + } + + interface IAcceptCallback { + (source: ITreeNodeScope, destination: ITreeNodeScope, destinationIndex: number): boolean; + } + + interface IDroppedCallback { + (eventInfo: IEventInfo): void; + } + + interface ICallbacks { + accept: IAcceptCallback; + dropped: IDroppedCallback; + } + + /** + * Internal representation of node in the UI + */ + interface ITreeNodeScope extends ng.IScope { + node: ITreeNode; + } + + interface IParentTreeNodeScope extends ITreeNodeScope { + isParent(nodeScope: ITreeNodeScope): boolean; + } + /** * Node in list */ From 44dad1d2373ed5e4135267b38b158202806dfbea Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Mon, 7 Dec 2015 17:56:00 -0500 Subject: [PATCH 098/134] Add getClient() to auth0.lock --- auth0.lock/auth0.lock.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/auth0.lock/auth0.lock.d.ts b/auth0.lock/auth0.lock.d.ts index bef269dbc..3269103ab 100644 --- a/auth0.lock/auth0.lock.d.ts +++ b/auth0.lock/auth0.lock.d.ts @@ -72,6 +72,8 @@ interface Auth0LockStatic { hide(callback: () => void): void; logout(callback: () => void): void; + + getClient(): Auth0Static; } declare var Auth0Lock: Auth0LockStatic; From 0c717541d80116f51bc2d9c0a4a2d731b0a50edb Mon Sep 17 00:00:00 2001 From: "Dylan R. E. Moonfire" Date: Mon, 7 Dec 2015 13:00:05 -0600 Subject: [PATCH 099/134] Added an interface to tokenizers to make it easier to pass into functinos. --- natural/natural.d.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/natural/natural.d.ts b/natural/natural.d.ts index d559f3801..249caf901 100644 --- a/natural/natural.d.ts +++ b/natural/natural.d.ts @@ -8,24 +8,27 @@ declare module "natural" { import events = require("events"); - class WordTokenizer { + interface Tokenizer { tokenize(text: string): string[]; } - class AggressiveTokenizer { + class WordTokenizer implements Tokenizer { tokenize(text: string): string[]; } - class TreebankWordTokenizer { + class AggressiveTokenizer implements Tokenizer { + tokenize(text: string): string[]; + } + class TreebankWordTokenizer implements Tokenizer { tokenize(text: string): string[]; } interface RegexTokenizerOptions { pattern: RegExp; discardEmpty?: boolean; } - class RegexpTokenizer { + class RegexpTokenizer implements Tokenizer { constructor(options: RegexTokenizerOptions); tokenize(text: string): string[]; } - class WordPunctTokenizer { + class WordPunctTokenizer implements Tokenizer { tokenize(text: string): string[]; } @@ -74,6 +77,10 @@ declare module "natural" { static restore(classifier: any, stemmer?: Stemmer): BayesClassifier; } + interface Phonetic { + compare(stringA: string, stringB: string): boolean; + process(token: string, maxLength?: number): string; + } var Metaphone: { compare(stringA: string, stringB: string): boolean; process(token: string, maxLength?: number): string; From 412522a8d49a6d557d79ea4e5485a5c097afad52 Mon Sep 17 00:00:00 2001 From: "Dylan R. E. Moonfire" Date: Mon, 7 Dec 2015 13:00:19 -0600 Subject: [PATCH 100/134] Added missing LancasterStemmer. --- natural/natural.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/natural/natural.d.ts b/natural/natural.d.ts index 249caf901..aaf3305a0 100644 --- a/natural/natural.d.ts +++ b/natural/natural.d.ts @@ -63,6 +63,9 @@ declare module "natural" { var PorterStemmerPt: { stem(token: string): string; } + var LancasterStemmer: { + stem(token: string): string; + } interface BayesClassifierCallback { (err: any, classifier: any): void } class BayesClassifier { From 494baf6691ed8fd7cbd4a0cfeee4b14086bc5245 Mon Sep 17 00:00:00 2001 From: "Dylan R. E. Moonfire" Date: Mon, 7 Dec 2015 13:08:03 -0600 Subject: [PATCH 101/134] Added initial definition for strip-json-comments. --- strip-json-comments/strip-json-comments-tests.ts | 11 +++++++++++ strip-json-comments/strip-json-comments.d.ts | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 strip-json-comments/strip-json-comments-tests.ts create mode 100644 strip-json-comments/strip-json-comments.d.ts diff --git a/strip-json-comments/strip-json-comments-tests.ts b/strip-json-comments/strip-json-comments-tests.ts new file mode 100644 index 000000000..3a9e91f3d --- /dev/null +++ b/strip-json-comments/strip-json-comments-tests.ts @@ -0,0 +1,11 @@ +// Type definitions for strip-json-comments +// Project: https://github.com/sindresorhus/strip-json-comments +// Definitions by: Dylan R. E. Moonfire +// Definitions: https://github.com/borisyankov/DefinitelyTyped +/// +import stripJsonComments = require("strip-json-comments"); + +const json = '{/*rainbows*/"unicorn":"cake"}'; + +JSON.parse(stripJsonComments(json)); +//=> {unicorn: 'cake'} diff --git a/strip-json-comments/strip-json-comments.d.ts b/strip-json-comments/strip-json-comments.d.ts new file mode 100644 index 000000000..721b83314 --- /dev/null +++ b/strip-json-comments/strip-json-comments.d.ts @@ -0,0 +1,13 @@ +// Type definitions for strip-json-comments +// Project: https://github.com/sindresorhus/strip-json-comments +// Definitions by: Dylan R. E. Moonfire +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "strip-json-comments" { + interface StripJsonOptions { + whitespace?: boolean; + } + + function stripJsonComments(input: string, opts?: StripJsonOptions): string; + export = stripJsonComments; +} From 7d58f574a7faf3caac3ccdfb10576199949b879c Mon Sep 17 00:00:00 2001 From: Steve Ognibene Date: Mon, 7 Dec 2015 18:53:12 -0600 Subject: [PATCH 102/134] Added module declaration so Typescript will emit require statement. --- big.js/big.js.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/big.js/big.js.d.ts b/big.js/big.js.d.ts index d4ca239e3..2ad360a56 100644 --- a/big.js/big.js.d.ts +++ b/big.js/big.js.d.ts @@ -200,4 +200,9 @@ declare module BigJsLibrary { } } +declare module "big.js" { + var bigjs : BigJsLibrary.BigJS; + export = bigjs; +} + declare var Big: BigJsLibrary.BigJS; From 93a277a4d4d624f5f3f9bcbde9f1543cb3f69c40 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Tue, 8 Dec 2015 03:26:05 -0600 Subject: [PATCH 103/134] [chai] Correct type of AssertionError AssertionError on the global chai object is the constructor for AssertionErrors, but the definition was written as though it was an instance of an assertion error. --- chai/chai.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chai/chai.d.ts b/chai/chai.d.ts index 28aaf48c2..e68e6fa3b 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -19,7 +19,7 @@ declare module Chai { use(fn: (chai: any, utils: any) => void): any; assert: AssertStatic; config: Config; - AssertionError: AssertionError; + AssertionError: typeof AssertionError; } export interface ExpectStatic extends AssertionStatic { From b91489d6662a27ca5e57ff2e7b727e75d6dbbef7 Mon Sep 17 00:00:00 2001 From: nakakura Date: Tue, 8 Dec 2015 19:15:04 +0900 Subject: [PATCH 104/134] update webrtc/MediaStream.d.ts --- webrtc/MediaStream.d.ts | 66 ++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/webrtc/MediaStream.d.ts b/webrtc/MediaStream.d.ts index fc88469f0..37b605592 100644 --- a/webrtc/MediaStream.d.ts +++ b/webrtc/MediaStream.d.ts @@ -9,23 +9,23 @@ /// interface ConstrainBooleanParameters { - exact: boolean; - ideal: boolean; + exact?: boolean; + ideal?: boolean; } interface NumberRange { - max: number; - min: number; + max?: number; + min?: number; } interface ConstrainNumberRange extends NumberRange { - exact: number; - ideal: number; + exact?: number; + ideal?: number; } interface ConstrainStringParameters { - exact: string | string[]; - ideal: string | string[]; + exact?: string | string[]; + ideal?: string | string[]; } interface MediaStreamConstraints { @@ -63,38 +63,38 @@ interface MediaTrackConstraintSet { } interface MediaTrackSupportedConstraints { - width: boolean; - height: boolean; - aspectRatio: boolean; - frameRate: boolean; - facingMode: boolean; - volume: boolean; - sampleRate: boolean; - sampleSize: boolean; - echoCancellation: boolean; - latency: boolean; - deviceId: boolean; - groupId: boolean; + width?: boolean; + height?: boolean; + aspectRatio?: boolean; + frameRate?: boolean; + facingMode?: boolean; + volume?: boolean; + sampleRate?: boolean; + sampleSize?: boolean; + echoCancellation?: boolean; + latency?: boolean; + deviceId?: boolean; + groupId?: boolean; } interface MediaStream extends EventTarget { id: string; active: boolean; - + onactive: EventListener; oninactive: EventListener; onaddtrack: (event: MediaStreamTrackEvent) => any; onremovetrack: (event: MediaStreamTrackEvent) => any; - + clone(): MediaStream; stop(): void; - + getAudioTracks(): MediaStreamTrack[]; getVideoTracks(): MediaStreamTrack[]; getTracks(): MediaStreamTrack[]; - + getTrackById(trackId: string): MediaStreamTrack; - + addTrack(track: MediaStreamTrack): void; removeTrack(track: MediaStreamTrack): void; } @@ -116,16 +116,16 @@ interface MediaStreamTrack extends EventTarget { muted: boolean; remote: boolean; readyState: MediaStreamTrackState; - + onmute: EventListener; onunmute: EventListener; onended: EventListener; onoverconstrained: EventListener; - + clone(): MediaStreamTrack; - + stop(): void; - + getCapabilities(): MediaTrackCapabilities; getConstraints(): MediaTrackConstraints; getSettings(): MediaTrackSettings; @@ -176,13 +176,13 @@ interface NavigatorGetUserMedia { interface Navigator { getUserMedia: NavigatorGetUserMedia; - + webkitGetUserMedia: NavigatorGetUserMedia; - + mozGetUserMedia: NavigatorGetUserMedia; - + msGetUserMedia: NavigatorGetUserMedia; - + mediaDevices: MediaDevices; } From f6e34ebc7c2750941f0416f2614fbc4679c35f71 Mon Sep 17 00:00:00 2001 From: pragyandas Date: Tue, 8 Dec 2015 16:19:41 +0530 Subject: [PATCH 105/134] changed return type of node() to Node --- d3/d3.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 396d0307e..236b87d55 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -791,7 +791,7 @@ declare module d3 { /** * Returns the first non-null element in the selection, or null otherwise. */ - node(): EventTarget; + node(): Node; /** * Returns the total number of elements in the selection. @@ -854,7 +854,7 @@ declare module d3 { call(func: (transition: Transition, ...args: any[]) => any, ...args: any[]): Transition; empty(): boolean; - node(): EventTarget; + node(): Node; size(): number; } From 2be15f1fe4719cae3c69fd87b70a81a5d7dd98a6 Mon Sep 17 00:00:00 2001 From: Glen Date: Tue, 8 Dec 2015 13:56:38 +0200 Subject: [PATCH 106/134] gulp-typescript: Add TsConfig --- gulp-typescript/gulp-typescript-tests.ts | 4 ++++ gulp-typescript/gulp-typescript.d.ts | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gulp-typescript/gulp-typescript-tests.ts b/gulp-typescript/gulp-typescript-tests.ts index 5abd5a152..ab40e478d 100644 --- a/gulp-typescript/gulp-typescript-tests.ts +++ b/gulp-typescript/gulp-typescript-tests.ts @@ -60,3 +60,7 @@ gulp.task('default', function () { .pipe(typescript()) .pipe(gulp.dest('built/local')); }); + +var compilerOptions = tsProject.config.compilerOptions; +var exclude = tsProject.config.exclude; +var files = tsProject.config.files; diff --git a/gulp-typescript/gulp-typescript.d.ts b/gulp-typescript/gulp-typescript.d.ts index 84d4b5d9c..5c7ab6b42 100644 --- a/gulp-typescript/gulp-typescript.d.ts +++ b/gulp-typescript/gulp-typescript.d.ts @@ -26,8 +26,15 @@ declare module "gulp-typescript" { typescript?: any; } + interface TsConfig { + files?: string[]; + exclude?: string[]; + compilerOptions?: any; + } + interface Project { - src(): NodeJS.ReadWriteStream + config: TsConfig; + src(): NodeJS.ReadWriteStream; } interface FilterSettings { From c34b1e67eee7862f1b3ec48e6c8b6878ae8b0500 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Tue, 8 Dec 2015 19:12:39 +0500 Subject: [PATCH 107/134] lodash: signatures of _.omit have been changed --- lodash/lodash-tests.ts | 48 ++++++++++++++++++------- lodash/lodash.d.ts | 80 +++++++++++++++++++++++------------------- 2 files changed, 80 insertions(+), 48 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index ce60da779..c409e2621 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -7073,19 +7073,43 @@ module TestFunctions { } } -interface HasName { - name: string; +// _.omit +module TestOmit { + let predicate: (element: any, key: string, collection: any) => boolean; + + { + let result: TResult; + + result = _.omit({}, 'a'); + result = _.omit({}, 0, 'a'); + result = _.omit({}, true, 0, 'a'); + result = _.omit({}, ['b', 1, false], true, 0, 'a'); + result = _.omit({}, predicate); + result = _.omit({}, predicate, any); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + result = _({}).omit('a'); + result = _({}).omit(0, 'a'); + result = _({}).omit(true, 0, 'a'); + result = _({}).omit(['b', 1, false], true, 0, 'a'); + result = _({}).omit(predicate); + result = _({}).omit(predicate, any); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + result = _({}).chain().omit('a'); + result = _({}).chain().omit(0, 'a'); + result = _({}).chain().omit(true, 0, 'a'); + result = _({}).chain().omit(['b', 1, false], true, 0, 'a'); + result = _({}).chain().omit(predicate); + result = _({}).chain().omit(predicate, any); + } } -result = _.omit({ 'name': 'moe', 'age': 40 }, 'age'); -result = _.omit({ 'name': 'moe', 'age': 40 }, ['age']); -result = _.omit({ 'name': 'moe', 'age': 40 }, function (value) { - return typeof value == 'number'; -}); -result = _({ 'name': 'moe', 'age': 40 }).omit('age').value(); -result = _({ 'name': 'moe', 'age': 40 }).omit(['age']).value(); -result = _({ 'name': 'moe', 'age': 40 }).omit(function (value) { - return typeof value == 'number'; -}).value(); // _.pairs module TestPairs { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 801b66be9..253107c7f 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -11842,54 +11842,62 @@ declare module _ { //_.omit interface LoDashStatic { /** - * Creates a shallow clone of object excluding the specified properties. Property names may be - * specified as individual arguments or as arrays of property names. If a callback is provided - * it will be executed for each property of object omitting the properties the callback returns - * truey for. The callback is bound to thisArg and invoked with three arguments; (value, key, - * object). - * @param object The source object. - * @param keys The properties to omit. - * @return An object without the omitted properties. - **/ - omit( + * The opposite of _.pick; this method creates an object composed of the own and inherited enumerable + * properties of object that are not omitted. + * + * @param object The source object. + * @param predicate The function invoked per iteration or property names to omit, specified as individual + * property names or arrays of property names. + * @param thisArg The this binding of predicate. + * @return Returns the new object. + */ + omit( object: T, - ...keys: string[]): Omitted; + predicate: ObjectIterator, + thisArg?: any + ): TResult; /** - * @see _.omit - **/ - omit( + * @see _.omit + */ + omit( object: T, - keys: string[]): Omitted; - - /** - * @see _.omit - **/ - omit( - object: T, - callback: ObjectIterator, - thisArg?: any): Omitted; + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): TResult; } interface LoDashImplicitObjectWrapper { /** - * @see _.omit - **/ - omit( - ...keys: string[]): LoDashImplicitObjectWrapper; + * @see _.omit + */ + omit( + predicate: ObjectIterator, + thisArg?: any + ): LoDashImplicitObjectWrapper; /** - * @see _.omit - **/ - omit( - keys: string[]): LoDashImplicitObjectWrapper; + * @see _.omit + */ + omit( + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.omit + */ + omit( + predicate: ObjectIterator, + thisArg?: any + ): LoDashExplicitObjectWrapper; /** - * @see _.omit - **/ - omit( - callback: ObjectIterator, - thisArg?: any): LoDashImplicitObjectWrapper; + * @see _.omit + */ + omit( + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): LoDashExplicitObjectWrapper; } //_.pairs From 4e8bcf2667a55bf807634e951ab081cc8717f338 Mon Sep 17 00:00:00 2001 From: paul cheung Date: Wed, 9 Dec 2015 00:25:53 +0800 Subject: [PATCH 108/134] add open event for dialog(as build failed in TypeScript 1.7) --- jqueryui/jqueryui.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index d9a33ed4f..9dd576e1a 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -362,7 +362,8 @@ declare module JQueryUI { title?: string; width?: any; // number or string zIndex?: number; - + + open?: DialogEvent; close?: DialogEvent; } From 59917025e03fac6bafdbcbfe5555c42ff8b3570e Mon Sep 17 00:00:00 2001 From: Sabeeh Ul Hussnain Date: Tue, 8 Dec 2015 22:33:30 +0500 Subject: [PATCH 109/134] file renamed --- lobibox/{lobibox.js-tests.ts => lobibox-tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lobibox/{lobibox.js-tests.ts => lobibox-tests.ts} (100%) diff --git a/lobibox/lobibox.js-tests.ts b/lobibox/lobibox-tests.ts similarity index 100% rename from lobibox/lobibox.js-tests.ts rename to lobibox/lobibox-tests.ts From cf491bf776f23f5828ebd8f8ce476c9dc7c9e9bc Mon Sep 17 00:00:00 2001 From: Nick Malaguti Date: Tue, 8 Dec 2015 13:08:32 -0500 Subject: [PATCH 110/134] Add definitions for chai-string --- chai-string/chai-string-tests.ts | 128 +++++++++++++++++++++++++++++++ chai-string/chai-string.d.ts | 45 +++++++++++ 2 files changed, 173 insertions(+) create mode 100644 chai-string/chai-string-tests.ts create mode 100644 chai-string/chai-string.d.ts diff --git a/chai-string/chai-string-tests.ts b/chai-string/chai-string-tests.ts new file mode 100644 index 000000000..f5380b076 --- /dev/null +++ b/chai-string/chai-string-tests.ts @@ -0,0 +1,128 @@ +/// +/// +/// + +var should = chai.should(); +var assert = chai.assert; +var expect = chai.expect; + +var chai_string = require('chai-string'); +chai.use(chai_string); + +describe('chai-string', function() { + + describe('#startsWith', function() { + + it('check that', function() { + var obj = { foo: 'hello world' }; + expect(obj).to.have.property('foo').that.startsWith('hello'); + }); + + }); + + describe('#startWith', function() { + + it('should return true', function() { + var str = 'abcdef', + prefix = 'abc'; + str.should.startWith(prefix); + }); + + it('should return false', function() { + var str = 'abcdef', + prefix = 'cba'; + str.should.not.startWith(prefix); + }); + + }); + + describe('#endWith', function() { + + it('should return true', function() { + var str = 'abcdef', + suffix = 'def'; + str.should.endWith(suffix); + }); + + it('should return false', function() { + var str = 'abcdef', + suffix = 'fed'; + str.should.not.endWith(suffix); + }); + + }); + + describe('tdd alias', function() { + + beforeEach(function() { + this.str = 'abcdef'; + this.str2 = 'a\nb\tc\r d ef'; + }); + + it('.startsWith', function() { + assert.startsWith(this.str, 'abc'); + }); + + it('.notStartsWith', function() { + assert.notStartsWith(this.str, 'cba'); + }); + + it('.endsWith', function() { + assert.endsWith(this.str, 'def'); + }); + + it('.notEndsWith', function() { + assert.notEndsWith(this.str, 'fed'); + }); + + it('.equalIgnoreCase', function() { + assert.equalIgnoreCase(this.str, 'AbCdEf'); + }); + + it('.notEqualIgnoreCase', function() { + assert.notEqualIgnoreCase(this.str, 'abDDD'); + }); + + it('.equalIgnoreSpaces', function() { + assert.equalIgnoreSpaces(this.str, this.str2); + }); + + it('.notEqualIgnoreSpaces', function() { + assert.notEqualIgnoreSpaces(this.str, this.str2 + 'g'); + }); + + it('.singleLine', function() { + assert.singleLine(this.str); + }); + + it('.notSingleLine', function() { + assert.notSingleLine("abc\ndef"); + }); + + it('.reverseOf', function() { + assert.reverseOf(this.str, 'fedcba'); + }); + + it('.notReverseOf', function() { + assert.notReverseOf(this.str, 'aaaaa'); + }); + + it('.palindrome', function() { + assert.palindrome('abcba'); + assert.palindrome('abccba'); + assert.palindrome(''); + }); + + it('.notPalindrome', function() { + assert.notPalindrome(this.str); + }); + + it('.entriesCount', function() { + assert.entriesCount('abcabd', 'ab', 2); + assert.entriesCount('ababd', 'ab', 2); + assert.entriesCount('abab', 'ab', 2); + assert.entriesCount('', 'ab', 0); + }); + + }); +}); diff --git a/chai-string/chai-string.d.ts b/chai-string/chai-string.d.ts new file mode 100644 index 000000000..fd1766523 --- /dev/null +++ b/chai-string/chai-string.d.ts @@ -0,0 +1,45 @@ +// Type definitions for chai-string 1.1.4 +// Project: https://github.com/onechiporenko/chai-string +// Definitions by: Nick Malaguti +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Chai { + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + startsWith(expected: string, message?: string): Assertion; + startWith(expected: string, message?: string): Assertion; + endsWith(expected: string, message?: string): Assertion; + endWith(expected: string, message?: string): Assertion; + equalIgnoreCase(expected: string, message?: string): Assertion; + equalIgnoreSpaces(expected: string, message?: string): Assertion; + singleLine(message?: string): Assertion; + reverseOf(message?: string): Assertion; + palindrome(message?: string): Assertion; + entriesCount(substr: string, expected: number, message?: string): Assertion; + } + + export interface Assert { + startsWith(val: string, exp: string, msg?: string): void; + notStartsWith(val: string, exp: string, msg?: string): void; + endsWith(val: string, exp: string, msg?: string): void; + notEndsWith(val: string, exp: string, msg?: string): void; + equalIgnoreCase(val: string, exp: string, msg?: string): void; + notEqualIgnoreCase(val: string, exp: string, msg?: string): void; + equalIgnoreSpaces(val: string, exp: string, msg?: string): void; + notEqualIgnoreSpaces(val: string, exp: string, msg?: string): void; + singleLine(val: string, msg?: string): void; + notSingleLine(val: string, msg?: string): void; + reverseOf(val: string, exp: string, msg?: string): void; + notReverseOf(val: string, exp: string, msg?: string): void; + palindrome(val: string, msg?: string): void; + notPalindrome(val: string, msg?: string): void; + entriesCount(str: string, substr: string, count: number, msg?: string): void; + } +} + +declare module 'chai-string' { + function chaiString(chai: any, utils: any): void; + namespace chaiString {} + export = chaiString; +} From aae1368c8ee377f6e9c59c2d6faf1acb3ece7e05 Mon Sep 17 00:00:00 2001 From: Joseph Dotson Date: Tue, 8 Dec 2015 14:47:30 -0500 Subject: [PATCH 111/134] passing a value to resolve should not be required in Q --- q/Q.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/q/Q.d.ts b/q/Q.d.ts index ba30b2745..2594df7f7 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -20,7 +20,7 @@ declare module Q { interface Deferred { promise: Promise; - resolve(value: T): void; + resolve(value?: T): void; reject(reason: any): void; notify(value: any): void; makeNodeResolver(): (reason: any, value: T) => void; From abb55149183ccd505da474fca2837851fd0ef508 Mon Sep 17 00:00:00 2001 From: bgrieder Date: Wed, 9 Dec 2015 10:51:13 +0100 Subject: [PATCH 112/134] Type definitions for bull: https://github.com/OptimalBits/bull --- bull/bull-tests.ts.tscparams | 1 + bull/bull-tests.tsx | 102 ++++++++++++ bull/bull.d.ts | 311 +++++++++++++++++++++++++++++++++++ 3 files changed, 414 insertions(+) create mode 100644 bull/bull-tests.ts.tscparams create mode 100644 bull/bull-tests.tsx create mode 100644 bull/bull.d.ts diff --git a/bull/bull-tests.ts.tscparams b/bull/bull-tests.ts.tscparams new file mode 100644 index 000000000..6641df12d --- /dev/null +++ b/bull/bull-tests.ts.tscparams @@ -0,0 +1 @@ +--target es5 --noImplicitAny --module commonjs diff --git a/bull/bull-tests.tsx b/bull/bull-tests.tsx new file mode 100644 index 000000000..bd25efc0c --- /dev/null +++ b/bull/bull-tests.tsx @@ -0,0 +1,102 @@ +/** + * Created by Bruno Grieder + */ + +/// + + +import * as Queue from "bull" + +var videoQueue = Queue( 'video transcoding', 6379, '127.0.0.1' ); +var audioQueue = Queue( 'audio transcoding', 6379, '127.0.0.1' ); +var imageQueue = Queue( 'image transcoding', 6379, '127.0.0.1' ); + +videoQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => { + + // job.data contains the custom data passed when the job was created + // job.jobId contains id of this job. + + // transcode video asynchronously and report progress + job.progress( 42 ); + + // call done when finished + done(); + + // or give a error if error + done( Error( 'error transcoding' ) ); + + // or pass it a result + done( null, { framerate: 29.5 /* etc... */ } ); + + // If the job throws an unhandled exception it is also handled correctly + throw (Error( 'some unexpected error' )); +} ); + +audioQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => { + // transcode audio asynchronously and report progress + job.progress( 42 ); + + // call done when finished + done(); + + // or give a error if error + done( Error( 'error transcoding' ) ); + + // or pass it a result + done( null, { samplerate: 48000 /* etc... */ } ); + + // If the job throws an unhandled exception it is also handled correctly + throw (Error( 'some unexpected error' )); +} ); + +imageQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => { + // transcode image asynchronously and report progress + job.progress( 42 ); + + // call done when finished + done(); + + // or give a error if error + done( Error( 'error transcoding' ) ); + + // or pass it a result + done( null, { width: 1280, height: 720 /* etc... */ } ); + + // If the job throws an unhandled exception it is also handled correctly + throw (Error( 'some unexpected error' )); +} ); + +videoQueue.add( { video: 'http://example.com/video1.mov' } ); +audioQueue.add( { audio: 'http://example.com/audio1.mp3' } ); +imageQueue.add( { image: 'http://example.com/image1.tiff' } ); + + +////////////////////////////////////////////////////////////////////////////////// +// +// Using Promises +// +////////////////////////////////////////////////////////////////////////////////// + +const fetchVideo = ( url: string ): Promise => { return null } +const transcodeVideo = ( data: any ): Promise => { return null } + +interface VideoJob extends Queue.Job { + data: {url: string} +} + + +videoQueue.process( ( job: VideoJob ) => { // don't forget to remove the done callback! + // Simply return a promise + return fetchVideo( job.data.url ).then( transcodeVideo ); + + // Handles promise rejection + return Promise.reject( new Error( 'error transcoding' ) ); + + // Passes the value the promise is resolved with to the "completed" event + return Promise.resolve( { framerate: 29.5 /* etc... */ } ); + + // If the job throws an unhandled exception it is also handled correctly + throw new Error( 'some unexpected error' ); + // same as + return Promise.reject( new Error( 'some unexpected error' ) ); +} ); diff --git a/bull/bull.d.ts b/bull/bull.d.ts new file mode 100644 index 000000000..b867c1123 --- /dev/null +++ b/bull/bull.d.ts @@ -0,0 +1,311 @@ +// Type definitions for bull 0.7.0 +// Project: https://github.com/OptimalBits/bull +// Definitions by: Bruno Grieder +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + + +declare module "bull" { + + import * as Redis from "redis"; + + /** + * This is the Queue constructor. + * It creates a new Queue that is persisted in Redis. + * Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session. + */ + function Bull(queueName: string, redisPort: number, redisHost: string, redisOpt?: Redis.ClientOpts): Bull.Queue; + + module Bull { + + export interface DoneCallback { + (error?: Error, value?: any): void + } + + export interface Job { + + id: string + + /** + * The custom data passed when the job was created + */ + data: Object; + + /** + * Report progress on a job + */ + progress(value: any): Promise; + + /** + * Removes a Job from the queue from all the lists where it may be included. + * @returns {Promise} A promise that resolves when the job is removed. + */ + remove(): Promise; + + /** + * Rerun a Job that has failed. + * @returns {Promise} A promise that resolves when the job is scheduled for retry. + */ + retry(): Promise; + } + + export interface Backoff { + + /** + * Backoff type, which can be either `fixed` or `exponential` + */ + type: string + + /** + * Backoff delay, in milliseconds + */ + delay: number; + } + + export interface AddOptions { + /** + * An amount of miliseconds to wait until this job can be processed. + * Note that for accurate delays, both server and clients should have their clocks synchronized + */ + delay?: number; + + /** + * A number of attempts to retry if the job fails [optional] + */ + attempts?: number; + + /** + * Backoff setting for automatic retries if the job fails + */ + backoff?: number | Backoff + + /** + * A boolean which, if true, adds the job to the right + * of the queue instead of the left (default false) + */ + lifo?: boolean; + + /** + * The number of milliseconds after which the job should be fail with a timeout error + */ + timeout?: number; + } + + export interface Queue { + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + * + * concurrency: Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + */ + process(callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + * + * concurrency: Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: (job: Job) => void): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + */ + process(callback: (job: Job) => void): Promise; + + // process(callback: (job: Job, done?: DoneCallback) => void): Promise; + + /** + * Creates a new job and adds it to the queue. + * If the queue is empty the job will be executed directly, + * otherwise it will be placed in the queue and executed as soon as possible. + */ + add(data: Object, opts?: AddOptions): Promise; + + /** + * Returns a promise that resolves when the queue is paused. + * The pause is global, meaning that all workers in all queue instances for a given queue will be paused. + * A paused queue will not process new jobs until resumed, + * but current jobs being processed will continue until they are finalized. + * + * Pausing a queue that is already paused does nothing. + */ + pause(): Promise; + + /** + * Returns a promise that resolves when the queue is resumed after being paused. + * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed. + * + * Resuming a queue that is not paused does nothing. + */ + resume(): Promise; + + /** + * Returns a promise that returns the number of jobs in the queue, waiting or paused. + * Since there may be other processes adding or processing jobs, this value may be true only for a very small amount of time. + */ + count(): Promise; + + /** + * Empties a queue deleting all the input lists and associated jobs. + */ + empty(): Promise; + + /** + * Closes the underlying redis client. Use this to perform a graceful shutdown. + * + * `close` can be called from anywhere, with one caveat: + * if called from within a job handler the queue won't close until after the job has been processed + */ + close(): Promise; + + /** + * Returns a promise that will return the job instance associated with the jobId parameter. + * If the specified job cannot be located, the promise callback parameter will be set to null. + */ + getJob(jobId: string): Promise; + + /** + * Tells the queue remove all jobs created outside of a grace period in milliseconds. + * You can clean the jobs with the following states: completed, waiting, active, delayed, and failed. + */ + clean(gracePeriod: number, jobsState?: string): Promise; + + /** + * Listens to queue events + * 'ready', 'error', 'activ', 'progress', 'completed', 'failed', 'paused', 'resumed', 'cleaned' + */ + on(eventName: string, callback: EventCallback): void; + } + + interface EventCallback { + (...args: any[]): void + } + + interface ReadyEventCallback extends EventCallback { + (): void; + } + + interface ErrorEventCallback extends EventCallback { + (error: Error): void; + } + + interface JobPromise { + /** + * Abort this job + */ + cancel(): void + } + + interface ActiveEventCallback extends EventCallback { + (job: Job, jobPromise: JobPromise): void; + } + + interface ProgressEventCallback extends EventCallback { + (job: Job, progress: any): void; + } + + interface CompletedEventCallback extends EventCallback { + (job: Job, result: Object): void; + } + + interface FailedEventCallback extends EventCallback { + (job: Job, error: Error): void; + } + + interface PausedEventCallback extends EventCallback { + (): void; + } + + interface ResumedEventCallback extends EventCallback { + (job?: Job): void; + } + + /** + * @see clean() for details + */ + interface CleanedEventCallback extends EventCallback { + (jobs: Job[], type: string): void; + } + } + + export = Bull; +} + +declare module "bull/lib/priority-queue" { + + import * as Bull from "bull"; + import * as Redis from "redis"; + + /** + * This is the Queue constructor of priority queue. + * + * It works same a normal queue, with same function and parameters. + * The only difference is that the Queue#add() allow an options opts.priority + * that could take ["low", "normal", "medium", "hight", "critical"]. If no options provider, "normal" will be taken. + * + * The priority queue will process more often highter priority jobs than lower. + */ + function PQueue(queueName: string, redisPort: number, redisHost: string, redisOpt?: Redis.ClientOpts): PQueue.PriorityQueue; + + module PQueue { + + export interface AddOptions extends Bull.AddOptions { + + /** + * "low", "normal", "medium", "high", "critical" + */ + priority?: string; + } + + + export interface PriorityQueue extends Bull.Queue { + + /** + * Creates a new job and adds it to the queue. + * If the queue is empty the job will be executed directly, + * otherwise it will be placed in the queue and executed as soon as possible. + */ + add(data: Object, opts?: PQueue.AddOptions): Promise; + + } + } + + export = PQueue; +} From f9944e023e7f1bcb13b080060dd253ed072dcd41 Mon Sep 17 00:00:00 2001 From: Roland Zwaga Date: Wed, 9 Dec 2015 11:56:35 +0100 Subject: [PATCH 113/134] Added IFontoMessageEventData interface (is currently undocumented publicly, so I can't post a link to any documentation) --- fontoxml/fontoxml-tests.ts | 7 +++++++ fontoxml/fontoxml.d.ts | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/fontoxml/fontoxml-tests.ts b/fontoxml/fontoxml-tests.ts index 7821806cf..11d47db89 100644 --- a/fontoxml/fontoxml-tests.ts +++ b/fontoxml/fontoxml-tests.ts @@ -25,4 +25,11 @@ var simpleinit:com.fontoxml.IInvocator = { documentIds: ["11-22-33","44-55-66"], cmsBaseUrl: "/test/", editSessionToken: "aa-bb-cc-dd-ee" +} + +var eventData:com.fontoxml.IFontoMessageEventData = { + command: "test-command", + type: "test-type", + scope: init, + metadata: {} } \ No newline at end of file diff --git a/fontoxml/fontoxml.d.ts b/fontoxml/fontoxml.d.ts index 4d621c234..8e6a0a2c7 100644 --- a/fontoxml/fontoxml.d.ts +++ b/fontoxml/fontoxml.d.ts @@ -37,4 +37,13 @@ declare module com.fontoxml roleId:string; } + //This is describes the object that is assigned to the MessageEvent.data + //property after the FontoXML editor posts a message + export interface IFontoMessageEventData { + command: string; + type: string; + scope: com.fontoxml.IInvocator; + metadata: any; + } + } \ No newline at end of file From e974403847dcd1d1464c5765668142920c41a447 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Wed, 9 Dec 2015 16:59:52 +0500 Subject: [PATCH 114/134] lodash: signatures of _.before have been changed --- lodash/lodash-tests.ts | 41 +++++++++++++++++++++++++---------------- lodash/lodash.d.ts | 21 ++++++++++++++++----- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index c409e2621..7674eaf6f 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -4658,22 +4658,31 @@ module TestBackflow { } // _.before -var testBeforeFn = ((n: number) => () => ++n)(0); -var testBeforeResultFn = <() => number>_.before<() => number>(3, testBeforeFn); -result = testBeforeResultFn(); -// → 1 -result = testBeforeResultFn(); -// → 2 -result = testBeforeResultFn(); -// → 2 -var testBeforeFn = ((n: number) => () => ++n)(0); -var testBeforeResultFn = <() => number>_(3).before<() => number>(testBeforeFn); -result = testBeforeResultFn(); -// → 1 -result = testBeforeResultFn(); -// → 2 -result = testBeforeResultFn(); -// → 2 +module TestBefore { + interface Func { + (a: string, b: number): boolean; + } + + let func: Func; + + { + let result: Func; + + _.before(42, func); + } + + { + let result: _.LoDashImplicitObjectWrapper; + + _(42).before(func); + } + + { + let result: _.LoDashExplicitObjectWrapper; + + _(42).chain().before(func); + } +} var funcBind = function(greeting: string, punctuation: string) { return greeting + ' ' + this.user + punctuation; }; var funcBound1: (punctuation: string) => any = _.bind(funcBind, { 'name': 'moe' }, 'hi'); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 253107c7f..f7a9a5694 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -8048,20 +8048,31 @@ declare module _ { interface LoDashStatic { /** * Creates a function that invokes func, with the this binding and arguments of the created function, while - * it is called less than n times. Subsequent calls to the created function return the result of the last func + * it’s called less than n times. Subsequent calls to the created function return the result of the last func * invocation. + * * @param n The number of calls at which func is no longer invoked. * @param func The function to restrict. * @return Returns the new restricted function. */ - before(n: number, func: TFunc): TFunc; + before( + n: number, + func: TFunc + ): TFunc; } interface LoDashImplicitWrapper { /** - * @sed _.before - */ - before(func: TFunc): TFunc; + * @see _.before + **/ + before(func: TFunc): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.before + **/ + before(func: TFunc): LoDashExplicitObjectWrapper; } //_.bind From 0f91841e0e2079d0d00603d30a5ccb30de5c86f4 Mon Sep 17 00:00:00 2001 From: Bart van den Burg Date: Wed, 9 Dec 2015 14:06:34 +0100 Subject: [PATCH 115/134] add definition for the angular translate filter --- angular-translate/angular-translate-tests.ts | 5 +++++ angular-translate/angular-translate.d.ts | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/angular-translate/angular-translate-tests.ts b/angular-translate/angular-translate-tests.ts index c60247f42..a19d27ade 100644 --- a/angular-translate/angular-translate-tests.ts +++ b/angular-translate/angular-translate-tests.ts @@ -36,4 +36,9 @@ app.controller('Ctrl', ($scope: Scope, $translate: angular.translate.ITranslateS $scope['changeLanguage'] = function (key: any) { $translate.use(key); }; +}).run(($filter: ng.IFilterService) => { + var x: string; + x = $filter('translate')('something'); + x = $filter('translate')('something', {}); + x = $filter('translate')('something', {}, ''); }); diff --git a/angular-translate/angular-translate.d.ts b/angular-translate/angular-translate.d.ts index e4f69c688..ee855af3d 100644 --- a/angular-translate/angular-translate.d.ts +++ b/angular-translate/angular-translate.d.ts @@ -108,3 +108,11 @@ declare module angular.translate { useLoaderCache(cache?: any): ITranslateProvider; } } + +declare module angular { + interface IFilterService { + (name:'translate'): { + (translationId: string, interpolateParams?: any, interpolation?: string): string; + }; + } +} From 1c5eb0244461d7dee0cf331cebb9830da29183bd Mon Sep 17 00:00:00 2001 From: Jacob Poul Richardt Date: Wed, 9 Dec 2015 14:09:09 +0100 Subject: [PATCH 116/134] Added missing viewModel property to ComponentConfig. --- knockout/knockout.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 8f5d6fef4..087e94588 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -562,6 +562,7 @@ declare module KnockoutComponentTypes { } interface ComponentConfig { + viewModel?: ViewModelFunction | ViewModelSharedInstance | ViewModelFactoryFunction | AMDModule; template: any; createViewModel?: any; } From 6c8a227ec4be73b5bc5027baf1422ed62293b3ac Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Wed, 9 Dec 2015 14:31:53 +0100 Subject: [PATCH 117/134] Fill out the full hopscotch API --- hopscotch/hopscotch-tests.ts | 2 +- hopscotch/hopscotch.d.ts | 79 +++++++++++++++++++++++++++++++----- 2 files changed, 70 insertions(+), 11 deletions(-) diff --git a/hopscotch/hopscotch-tests.ts b/hopscotch/hopscotch-tests.ts index 52d021395..fb1d1c68a 100644 --- a/hopscotch/hopscotch-tests.ts +++ b/hopscotch/hopscotch-tests.ts @@ -1,6 +1,6 @@ /// -var tourDefinition = { +var tourDefinition: TourDefinition = { id: 'intro-tour', steps: [ { diff --git a/hopscotch/hopscotch.d.ts b/hopscotch/hopscotch.d.ts index e7f7be6e9..1baac775b 100644 --- a/hopscotch/hopscotch.d.ts +++ b/hopscotch/hopscotch.d.ts @@ -3,14 +3,44 @@ // Definitions by: Tim Perry // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface TourDefinition { +declare type CallbackNameNamesOrDefinition = string | string[] | (() => void); + +interface HopscotchConfiguration { + bubbleWidth?: number; + buddleHeight?: number; + + smoothScroll?: boolean; + scrollDuration?: number; + scrollTopMargin?: number; + + showCloseButton?: boolean; + showNextButton?: boolean; + showPrevButton?: boolean; + + arrowWidth?: number; + skipIfNoElement?: boolean; + nextOnTargetClick?: boolean; + + onNext?: CallbackNameNamesOrDefinition; + onPrev?: CallbackNameNamesOrDefinition; + onStart?: CallbackNameNamesOrDefinition; + onEnd?: CallbackNameNamesOrDefinition; + onClose?: CallbackNameNamesOrDefinition; + onError?: CallbackNameNamesOrDefinition; + + i18n?: { + nextBtn?: string; + prevBtn?: string; + doneBtn?: string; + skipBtn?: string; + closeTooltip?: string; + stepNums?: string[]; + } +} + +interface TourDefinition extends HopscotchConfiguration { id: string; steps: StepDefinition[]; - - skipIfNoElement: boolean; - - onEnd: () => void; - onClose: () => void; } interface StepDefinition { @@ -20,22 +50,51 @@ interface StepDefinition { title?: string; content?: string; + width?: number; + padding?: number; + xOffset?: number; yOffset?: number; arrowOffset?: number; - height?: number; - width?: number; + delay?: number; + zIndex?: number; - multipage?: boolean; showNextButton?: boolean; + showPrevButton?: boolean; + showCTAButton?: boolean; + + ctaLabel?: string; + multipage?: boolean; + showSkip?: boolean; + fixedElement?: boolean; nextOnTargetClick?: boolean; - onShow?: () => void; + onPrev?: CallbackNameNamesOrDefinition; + onNext?: CallbackNameNamesOrDefinition; + onShow?: CallbackNameNamesOrDefinition; + onCTA?: CallbackNameNamesOrDefinition; } interface HopscotchStatic { startTour(tour: TourDefinition, stepNum?: number): void; + showStep(id: number): void; + prevStep(): void; + nextStep(): void; + endTour(clearCookie: boolean): void; + configure(options: HopscotchConfiguration): void; + getCurrTour(): TourDefinition; + getCurrStepNum(): number; + getState(): string; + + listen(eventName: string, callback: () => void): void; + unlisten(eventName: string, callback: () => void): void; + removeCallbacks(eventName?: string, tourOnly?: boolean): void; + + registerHelper(id: string, helper: (...args: any[]) => void): void; + + resetDefaultI18N(): void; + resetDefaultOptions(): void; } declare var hopscotch: HopscotchStatic; From 957c41c644b150a1ecba4377aa2c6f7f6442eef0 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 9 Dec 2015 14:41:05 +0000 Subject: [PATCH 118/134] Update flux.d.ts Replaced dependency upon `react-global.d.ts` in favour of the more targeted `react.d.ts` --- flux/flux.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flux/flux.d.ts b/flux/flux.d.ts index c65892321..13d716311 100644 --- a/flux/flux.d.ts +++ b/flux/flux.d.ts @@ -3,7 +3,7 @@ // Definitions by: Steve Baker , Giedrius Grabauskas // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// declare module Flux { @@ -70,6 +70,7 @@ declare module "flux" { declare module FluxUtils { + import React = __React; export class Container { constructor(); /** From f2afd9c258c5f6daebc6254ec08aab72e5794b94 Mon Sep 17 00:00:00 2001 From: jmercha Date: Thu, 10 Dec 2015 01:26:07 +1030 Subject: [PATCH 119/134] support es6 import syntax for gulp-babel --- gulp-babel/gulp-babel.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gulp-babel/gulp-babel.d.ts b/gulp-babel/gulp-babel.d.ts index 98d33881c..632cb86f9 100644 --- a/gulp-babel/gulp-babel.d.ts +++ b/gulp-babel/gulp-babel.d.ts @@ -36,5 +36,7 @@ declare module 'gulp-babel' { retainLines?: boolean }): NodeJS.ReadWriteStream; + module babel { } + export = babel; } From d5eca5e9a3305939212e0479492dd09979345408 Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 10 Dec 2015 00:08:18 +0900 Subject: [PATCH 120/134] github-electron: Add 'electron' module for main process --- github-electron/github-electron-main-tests.ts | 88 ++++++++++--------- github-electron/github-electron-main.d.ts | 15 ++++ github-electron/github-electron.d.ts | 12 ++- 3 files changed, 70 insertions(+), 45 deletions(-) diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index bafbaa49f..30f6bee22 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -1,21 +1,23 @@ /// -import app = require('app'); -import AutoUpdater = require('auto-updater'); -import BrowserWindow = require('browser-window'); -import ContentTracing = require('content-tracing'); -import Dialog = require('dialog'); -import GlobalShortcut = require('global-shortcut'); -import ipc = require('ipc'); -import Menu = require('menu'); -import MenuItem = require('menu-item'); -import PowerMonitor = require('power-monitor'); -import Protocol = require('protocol'); -import Tray = require('tray'); -import Clipboard = require('clipboard'); -import CrashReporter = require('crash-reporter'); -import NativeImage = require('native-image'); -import Screen = require('screen'); -import Shell = require('shell'); +import { + app, + autoUpdater, + BrowserWindow, + contentTracing, + dialog, + globalShortcut, + ipcMain, + Menu, + MenuItem, + powerMonitor, + protocol, + Tray, + clipboard, + crashReporter, + nativeImage, + screen, + shell +} from 'electron'; import path = require('path'); @@ -39,8 +41,8 @@ app.on('window-all-closed', () => { var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) { // Someone tried to run a second instance, we should focus our window if (mainWindow) { - if (mainWindow.isMinimized()) mainWindow.restore(); - mainWindow.focus(); + if (mainWindow.isMinimized()) mainWindow.restore(); + mainWindow.focus(); } return true; }); @@ -156,7 +158,7 @@ app.on('ready', () => { onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`); }); -ipc.on('online-status-changed', (event: any, status: any) => { +ipcMain.on('online-status-changed', (event: any, status: any) => { console.log(status); }); @@ -183,7 +185,7 @@ app.commandLine.appendSwitch('vmodule', 'console=0'); // auto-updater // https://github.com/atom/electron/blob/master/docs/api/auto-updater.md -AutoUpdater.setFeedURL('http://mycompany.com/myapp/latest?version=' + app.getVersion()); +autoUpdater.setFeedURL('http://mycompany.com/myapp/latest?version=' + app.getVersion()); // browser-window // https://github.com/atom/electron/blob/master/docs/api/browser-window.md @@ -199,11 +201,11 @@ win.show(); // content-tracing // https://github.com/atom/electron/blob/master/docs/api/content-tracing.md -ContentTracing.startRecording('*', ContentTracing.DEFAULT_OPTIONS, () => { +contentTracing.startRecording('*', contentTracing.DEFAULT_OPTIONS, () => { console.log('Tracing started'); setTimeout(() => { - ContentTracing.stopRecording('', path => { + contentTracing.stopRecording('', path => { console.log('Tracing data recorded to ' + path); }); }, 5000); @@ -212,7 +214,7 @@ ContentTracing.startRecording('*', ContentTracing.DEFAULT_OPTIONS, () => { // dialog // https://github.com/atom/electron/blob/master/docs/api/dialog.md -console.log(Dialog.showOpenDialog({ +console.log(dialog.showOpenDialog({ properties: ['openFile', 'openDirectory', 'multiSelections'] })); @@ -220,30 +222,30 @@ console.log(Dialog.showOpenDialog({ // https://github.com/atom/electron/blob/master/docs/api/global-shortcut.md // Register a 'ctrl+x' shortcut listener. -var ret = GlobalShortcut.register('ctrl+x', () => { +var ret = globalShortcut.register('ctrl+x', () => { console.log('ctrl+x is pressed'); }); if (!ret) console.log('registerion fails'); // Check whether a shortcut is registered. -console.log(GlobalShortcut.isRegistered('ctrl+x')); +console.log(globalShortcut.isRegistered('ctrl+x')); // Unregister a shortcut. -GlobalShortcut.unregister('ctrl+x'); +globalShortcut.unregister('ctrl+x'); // Unregister all shortcuts. -GlobalShortcut.unregisterAll(); +globalShortcut.unregisterAll(); -// ipc +// ipcMain // https://github.com/atom/electron/blob/master/docs/api/ipc-main-process.md -ipc.on('asynchronous-message', (event: any, arg: any) => { +ipcMain.on('asynchronous-message', (event: any, arg: any) => { console.log(arg); // prints "ping" event.sender.send('asynchronous-reply', 'pong'); }); -ipc.on('synchronous-message', (event: any, arg: any) => { +ipcMain.on('synchronous-message', (event: any, arg: any) => { console.log(arg); // prints "ping" event.returnValue = 'pong'; }); @@ -405,7 +407,7 @@ Menu.buildFromTemplate([ // https://github.com/atom/electron/blob/master/docs/api/power-monitor.md app.on('ready', () => { - PowerMonitor.on('suspend', () => { + powerMonitor.on('suspend', () => { console.log('The system is going to sleep'); }); }); @@ -414,9 +416,9 @@ app.on('ready', () => { // https://github.com/atom/electron/blob/master/docs/api/protocol.md app.on('ready', () => { - Protocol.registerProtocol('atom', (request: any) => { + protocol.registerProtocol('atom', (request: any) => { var url = request.url.substr(7); - return new Protocol.RequestFileJob(path.normalize(`${__dirname}/${url}`)); + return new protocol.RequestFileJob(path.normalize(`${__dirname}/${url}`)); }); }); @@ -440,26 +442,26 @@ app.on('ready', () => { // clipboard // https://github.com/atom/electron/blob/master/docs/api/clipboard.md -Clipboard.writeText('Example String'); -Clipboard.writeText('Example String', 'selection'); -console.log(Clipboard.readText('selection')); +clipboard.writeText('Example String'); +clipboard.writeText('Example String', 'selection'); +console.log(clipboard.readText('selection')); // crash-reporter // https://github.com/atom/electron/blob/master/docs/api/crash-reporter.md -CrashReporter.start({ +crashReporter.start({ productName: 'YourName', companyName: 'YourCompany', submitURL: 'https://your-domain.com/url-to-submit', autoSubmit: true }); -// NativeImage +// nativeImage // https://github.com/atom/electron/blob/master/docs/api/native-image.md var appIcon2 = new Tray('/Users/somebody/images/icon.png'); var window2 = new BrowserWindow({ icon: '/Users/somebody/images/window.png' }); -var image = Clipboard.readImage(); +var image = clipboard.readImage(); var appIcon3 = new Tray(image); var appIcon4 = new Tray('/Users/somebody/images/icon.png'); @@ -467,12 +469,12 @@ var appIcon4 = new Tray('/Users/somebody/images/icon.png'); // https://github.com/atom/electron/blob/master/docs/api/screen.md app.on('ready', () => { - var size = Screen.getPrimaryDisplay().workAreaSize; + var size = screen.getPrimaryDisplay().workAreaSize; mainWindow = new BrowserWindow({ width: size.width, height: size.height }); }); app.on('ready', () => { - var displays = Screen.getAllDisplays(); + var displays = screen.getAllDisplays(); var externalDisplay: any = null; for (var i in displays) { if (displays[i].bounds.x > 0 || displays[i].bounds.y > 0) { @@ -492,4 +494,4 @@ app.on('ready', () => { // shell // https://github.com/atom/electron/blob/master/docs/api/shell.md -Shell.openExternal('https://github.com'); +shell.openExternal('https://github.com'); diff --git a/github-electron/github-electron-main.d.ts b/github-electron/github-electron-main.d.ts index a133155a9..eb74ee446 100644 --- a/github-electron/github-electron-main.d.ts +++ b/github-electron/github-electron-main.d.ts @@ -254,6 +254,21 @@ declare module 'tray' { export = Tray; } +declare module 'electron' { + export var app: GitHubElectron.App; + export var autoUpdater: GitHubElectron.AutoUpdater; + export var BrowserWindow: typeof GitHubElectron.BrowserWindow; + export var contentTracing: GitHubElectron.ContentTracing; + export var dialog: GitHubElectron.Dialog; + export var globalShortcut: GitHubElectron.GlobalShortcut; + export var ipcMain: NodeJS.EventEmitter; + export var Menu: typeof GitHubElectron.Menu; + export var MenuItem: typeof GitHubElectron.MenuItem; + export var powerMonitor: NodeJS.EventEmitter; + export var protocol: GitHubElectron.Protocol; + export var Tray: typeof GitHubElectron.Tray; +} + interface NodeRequireFunction { (id: 'app'): GitHubElectron.App (id: 'auto-updater'): GitHubElectron.AutoUpdater diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index d4ab0099f..d2909c1a4 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1407,12 +1407,12 @@ declare module GitHubElectron { } declare module 'clipboard' { - var clipboard: GitHubElectron.Clipboard + var clipboard: GitHubElectron.Clipboard; export = clipboard; } declare module 'crash-reporter' { - var crashReporter: GitHubElectron.CrashReporter + var crashReporter: GitHubElectron.CrashReporter; export = crashReporter; } @@ -1431,6 +1431,14 @@ declare module 'shell' { export = shell; } +declare module 'electron' { + export var clipboard: GitHubElectron.Clipboard; + export var crashReporter: GitHubElectron.CrashReporter; + export var nativeImage: GitHubElectron.NativeImage; + export var screen: GitHubElectron.Screen; + export var shell: GitHubElectron.Shell; +} + interface Window { /** * Creates a new window. From cfa613956a5acac7df4bcfc2918973d6ea22cd5c Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 10 Dec 2015 00:09:42 +0900 Subject: [PATCH 121/134] github-electron: Remove all deprecated modules from definitions for main process https://github.com/atom/electron/commit/c5913c31493dd36b1455c5f1c9a28d65f67c5c72 --- github-electron/github-electron-main.d.ts | 100 ++++------------------ github-electron/github-electron.d.ts | 39 ++------- 2 files changed, 24 insertions(+), 115 deletions(-) diff --git a/github-electron/github-electron-main.d.ts b/github-electron/github-electron-main.d.ts index eb74ee446..aa83e8801 100644 --- a/github-electron/github-electron-main.d.ts +++ b/github-electron/github-electron-main.d.ts @@ -192,94 +192,28 @@ declare module GitHubElectron { RequestStringJob: typeof RequestStringJob; RequestBufferJob: typeof RequestBufferJob; } -} -declare module 'app' { - var _app: GitHubElectron.App; - export = _app; -} - -declare module 'auto-updater' { - var _autoUpdater: GitHubElectron.AutoUpdater; - export = _autoUpdater; -} - -declare module 'browser-window' { - var BrowserWindow: typeof GitHubElectron.BrowserWindow; - export = BrowserWindow; -} - -declare module 'content-tracing' { - var contentTracing: GitHubElectron.ContentTracing - export = contentTracing; -} - -declare module 'dialog' { - var dialog: GitHubElectron.Dialog - export = dialog; -} - -declare module 'global-shortcut' { - var globalShortcut: GitHubElectron.GlobalShortcut; - export = globalShortcut; -} - -declare module 'ipc' { - var ipc: NodeJS.EventEmitter; - export = ipc; -} - -declare module 'menu' { - var Menu: typeof GitHubElectron.Menu; - export = Menu; -} - -declare module 'menu-item' { - var MenuItem: typeof GitHubElectron.MenuItem; - export = MenuItem; -} - -declare module 'power-monitor' { - var powerMonitor: NodeJS.EventEmitter; - export = powerMonitor; -} - -declare module 'protocol' { - var protocol: GitHubElectron.Protocol; - export = protocol; -} - -declare module 'tray' { - var Tray: typeof GitHubElectron.Tray; - export = Tray; + interface Electron { + app: GitHubElectron.App; + autoUpdater: GitHubElectron.AutoUpdater; + BrowserWindow: typeof GitHubElectron.BrowserWindow; + contentTracing: GitHubElectron.ContentTracing; + dialog: GitHubElectron.Dialog; + globalShortcut: GitHubElectron.GlobalShortcut; + ipcMain: NodeJS.EventEmitter; + Menu: typeof GitHubElectron.Menu; + MenuItem: typeof GitHubElectron.MenuItem; + powerMonitor: NodeJS.EventEmitter; + protocol: GitHubElectron.Protocol; + Tray: typeof GitHubElectron.Tray; + } } declare module 'electron' { - export var app: GitHubElectron.App; - export var autoUpdater: GitHubElectron.AutoUpdater; - export var BrowserWindow: typeof GitHubElectron.BrowserWindow; - export var contentTracing: GitHubElectron.ContentTracing; - export var dialog: GitHubElectron.Dialog; - export var globalShortcut: GitHubElectron.GlobalShortcut; - export var ipcMain: NodeJS.EventEmitter; - export var Menu: typeof GitHubElectron.Menu; - export var MenuItem: typeof GitHubElectron.MenuItem; - export var powerMonitor: NodeJS.EventEmitter; - export var protocol: GitHubElectron.Protocol; - export var Tray: typeof GitHubElectron.Tray; + var electron: GitHubElectron.Electron; + export = electron; } interface NodeRequireFunction { - (id: 'app'): GitHubElectron.App - (id: 'auto-updater'): GitHubElectron.AutoUpdater - (id: 'browser-window'): typeof GitHubElectron.BrowserWindow - (id: 'content-tracing'): GitHubElectron.ContentTracing - (id: 'dialog'): GitHubElectron.Dialog - (id: 'global-shortcut'): GitHubElectron.GlobalShortcut - (id: 'ipc'): NodeJS.EventEmitter - (id: 'menu'): typeof GitHubElectron.Menu - (id: 'menu-item'): typeof GitHubElectron.MenuItem - (id: 'power-monitor'): NodeJS.EventEmitter - (id: 'protocol'): GitHubElectron.Protocol - (id: 'tray'): typeof GitHubElectron.Tray + (id: 'electron'): GitHubElectron.Electron; } diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index d2909c1a4..05a4a6571 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1404,39 +1404,14 @@ declare module GitHubElectron { */ beep(): void; } -} -declare module 'clipboard' { - var clipboard: GitHubElectron.Clipboard; - export = clipboard; -} - -declare module 'crash-reporter' { - var crashReporter: GitHubElectron.CrashReporter; - export = crashReporter; -} - -declare module 'native-image' { - var nativeImage: typeof GitHubElectron.NativeImage; - export = nativeImage; -} - -declare module 'screen' { - var screen: GitHubElectron.Screen; - export = screen; -} - -declare module 'shell' { - var shell: GitHubElectron.Shell; - export = shell; -} - -declare module 'electron' { - export var clipboard: GitHubElectron.Clipboard; - export var crashReporter: GitHubElectron.CrashReporter; - export var nativeImage: GitHubElectron.NativeImage; - export var screen: GitHubElectron.Screen; - export var shell: GitHubElectron.Shell; + interface Electron { + clipboard: GitHubElectron.Clipboard; + crashReporter: GitHubElectron.CrashReporter; + nativeImage: GitHubElectron.NativeImage; + screen: GitHubElectron.Screen; + shell: GitHubElectron.Shell; + } } interface Window { From c073d5b052c3c8179ae4f45233112346a74e0a1a Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 10 Dec 2015 00:14:18 +0900 Subject: [PATCH 122/134] github-electron: Add 'electron' module for renderer process --- .../github-electron-renderer-tests.ts | 46 ++++++++++--------- github-electron/github-electron-renderer.d.ts | 6 +++ 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/github-electron/github-electron-renderer-tests.ts b/github-electron/github-electron-renderer-tests.ts index 86680600f..88fa4fcd5 100644 --- a/github-electron/github-electron-renderer-tests.ts +++ b/github-electron/github-electron-renderer-tests.ts @@ -1,23 +1,25 @@ /// -import ipc = require('ipc'); -import remote = require('remote'); -import WebFrame = require('web-frame'); -import Clipboard = require('clipboard'); -import CrashReporter = require('crash-reporter'); -import NativeImage = require('native-image'); -import Screen = require('screen'); -import Shell = require('shell'); +import { + ipcRenderer, + remote, + webFrame, + clipboard, + crashReporter, + nativeImage, + screen, + shell +} from 'electron'; import fs = require('fs'); // In renderer process (web page). // https://github.com/atom/electron/blob/master/docs/api/ipc-renderer.md -console.log(ipc.sendSync('synchronous-message', 'ping')); // prints "pong" +console.log(ipcRenderer.sendSync('synchronous-message', 'ping')); // prints "pong" -ipc.on('asynchronous-reply', (arg: any) => { +ipcRenderer.on('asynchronous-reply', (arg: any) => { console.log(arg); // prints "pong" }); -ipc.send('asynchronous-message', 'ping'); +ipcRenderer.send('asynchronous-message', 'ping'); // remote // https://github.com/atom/electron/blob/master/docs/api/remote.md @@ -45,9 +47,9 @@ remote.getCurrentWindow().capturePage(buf => { // web-frame // https://github.com/atom/electron/blob/master/docs/api/web-frame.md -WebFrame.setZoomFactor(2); +webFrame.setZoomFactor(2); -WebFrame.setSpellCheckProvider('en-US', true, { +webFrame.setSpellCheckProvider('en-US', true, { spellCheck: text => { return !(require('spellchecker').isMisspelled(text)); } @@ -56,27 +58,27 @@ WebFrame.setSpellCheckProvider('en-US', true, { // clipboard // https://github.com/atom/electron/blob/master/docs/api/clipboard.md -Clipboard.writeText('Example String'); -Clipboard.writeText('Example String', 'selection'); -console.log(Clipboard.readText('selection')); +clipboard.writeText('Example String'); +clipboard.writeText('Example String', 'selection'); +console.log(clipboard.readText('selection')); // crash-reporter // https://github.com/atom/electron/blob/master/docs/api/crash-reporter.md -CrashReporter.start({ +crashReporter.start({ productName: 'YourName', companyName: 'YourCompany', submitURL: 'https://your-domain.com/url-to-submit', autoSubmit: true }); -// NativeImage +// nativeImage // https://github.com/atom/electron/blob/master/docs/api/native-image.md var Tray: typeof GitHubElectron.Tray = remote.require('Tray'); var appIcon2 = new Tray('/Users/somebody/images/icon.png'); var window2 = new BrowserWindow({ icon: '/Users/somebody/images/window.png' }); -var image = Clipboard.readImage(); +var image = clipboard.readImage(); var appIcon3 = new Tray(image); var appIcon4 = new Tray('/Users/somebody/images/icon.png'); @@ -88,12 +90,12 @@ var app: GitHubElectron.App = remote.require('app'); var mainWindow: GitHubElectron.BrowserWindow = null; app.on('ready', () => { - var size = Screen.getPrimaryDisplay().workAreaSize; + var size = screen.getPrimaryDisplay().workAreaSize; mainWindow = new BrowserWindow({ width: size.width, height: size.height }); }); app.on('ready', () => { - var displays = Screen.getAllDisplays(); + var displays = screen.getAllDisplays(); var externalDisplay: any = null; for (var i in displays) { if (displays[i].bounds.x > 0 || displays[i].bounds.y > 0) { @@ -113,4 +115,4 @@ app.on('ready', () => { // shell // https://github.com/atom/electron/blob/master/docs/api/shell.md -Shell.openExternal('https://github.com'); +shell.openExternal('https://github.com'); diff --git a/github-electron/github-electron-renderer.d.ts b/github-electron/github-electron-renderer.d.ts index 62b29d9cd..2ef31d967 100644 --- a/github-electron/github-electron-renderer.d.ts +++ b/github-electron/github-electron-renderer.d.ts @@ -109,6 +109,12 @@ declare module 'web-frame' { export = webframe; } +declare module 'electron' { + var remote: GitHubElectron.Remote; + var ipcRenderer: GitHubElectron.InProcess; + var webFrame: GitHubElectron.WebFrame; +} + interface NodeRequireFunction { (id: 'ipc'): GitHubElectron.InProcess (id: 'remote'): GitHubElectron.Remote From 9e2e3b7b9c59bd4c6f9eff9423444f80117a360f Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 10 Dec 2015 00:15:06 +0900 Subject: [PATCH 123/134] github-electron: Remove deprecated modules from definitions for renderer process https://github.com/atom/electron/commit/c5913c31493dd36b1455c5f1c9a28d65f67c5c72 --- github-electron/github-electron-renderer.d.ts | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/github-electron/github-electron-renderer.d.ts b/github-electron/github-electron-renderer.d.ts index 2ef31d967..7cfdca5a0 100644 --- a/github-electron/github-electron-renderer.d.ts +++ b/github-electron/github-electron-renderer.d.ts @@ -92,31 +92,19 @@ declare module GitHubElectron { */ registerURLSchemeAsSecure(scheme: string): void; } -} -declare module 'ipc' { - var inProcess: GitHubElectron.InProcess; - export = inProcess; -} - -declare module 'remote' { - var remote: GitHubElectron.Remote; - export = remote; -} - -declare module 'web-frame' { - var webframe: GitHubElectron.WebFrame; - export = webframe; + export interface Electron { + remote: GitHubElectron.Remote; + ipcRenderer: GitHubElectron.InProcess; + webFrame: GitHubElectron.WebFrame; + } } declare module 'electron' { - var remote: GitHubElectron.Remote; - var ipcRenderer: GitHubElectron.InProcess; - var webFrame: GitHubElectron.WebFrame; + var electron: GitHubElectron.Electron; + export = electron; } interface NodeRequireFunction { - (id: 'ipc'): GitHubElectron.InProcess - (id: 'remote'): GitHubElectron.Remote - (id: 'web-frame'): GitHubElectron.WebFrame + (id: 'electron'): GitHubElectron.Electron; } From b10b59fe42978878f23b6bbae44c1c98a76ec492 Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 10 Dec 2015 00:44:14 +0900 Subject: [PATCH 124/134] github-electron: Unite main process definitions and renderer process definitions because currently github-electron-renderer.d.ts and github-electron-main.d.ts can't be used with tsd.d.ts at the same time. tsd.d.ts includes both definition files. So I unite them to resolve it. --- github-electron/github-electron-main-tests.ts | 2 +- github-electron/github-electron-main.d.ts | 219 ------------- .../github-electron-renderer-tests.ts | 2 +- github-electron/github-electron-renderer.d.ts | 110 ------- github-electron/github-electron.d.ts | 305 +++++++++++++++++- 5 files changed, 302 insertions(+), 336 deletions(-) delete mode 100644 github-electron/github-electron-main.d.ts delete mode 100644 github-electron/github-electron-renderer.d.ts diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index 30f6bee22..84f1ca89c 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -1,4 +1,4 @@ -/// +/// import { app, autoUpdater, diff --git a/github-electron/github-electron-main.d.ts b/github-electron/github-electron-main.d.ts deleted file mode 100644 index aa83e8801..000000000 --- a/github-electron/github-electron-main.d.ts +++ /dev/null @@ -1,219 +0,0 @@ -// Type definitions for the Electron 0.25.2 main process -// Project: http://electron.atom.io/ -// Definitions by: jedmao -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module GitHubElectron { - interface ContentTracing { - /** - * Get a set of category groups. The category groups can change as new code paths are reached. - * @param callback Called once all child processes have acked to the getCategories request. - */ - getCategories(callback: (categoryGroups: any[]) => void): void; - /** - * Start recording on all processes. Recording begins immediately locally, and asynchronously - * on child processes as soon as they receive the EnableRecording request. - * @param categoryFilter A filter to control what category groups should be traced. - * A filter can have an optional "-" prefix to exclude category groups that contain - * a matching category. Having both included and excluded category patterns in the - * same list would not be supported. - * @param options controls what kind of tracing is enabled, it could be a OR-ed - * combination of tracing.DEFAULT_OPTIONS, tracing.ENABLE_SYSTRACE, tracing.ENABLE_SAMPLING - * and tracing.RECORD_CONTINUOUSLY. - * @param callback Called once all child processes have acked to the startRecording request. - */ - startRecording(categoryFilter: string, options: number, callback: Function): void; - /** - * Stop recording on all processes. Child processes typically are caching trace data and - * only rarely flush and send trace data back to the main process. That is because it may - * be an expensive operation to send the trace data over IPC, and we would like to avoid - * much runtime overhead of tracing. So, to end tracing, we must asynchronously ask all - * child processes to flush any pending trace data. - * @param resultFilePath Trace data will be written into this file if it is not empty, - * or into a temporary file. - * @param callback Called once all child processes have acked to the stopRecording request. - */ - stopRecording(resultFilePath: string, callback: - /** - * @param filePath A file that contains the traced data. - */ - (filePath: string) => void - ): void; - /** - * Start monitoring on all processes. Monitoring begins immediately locally, and asynchronously - * on child processes as soon as they receive the startMonitoring request. - * @param callback Called once all child processes have acked to the startMonitoring request. - */ - startMonitoring(categoryFilter: string, options: number, callback: Function): void; - /** - * Stop monitoring on all processes. - * @param callback Called once all child processes have acked to the stopMonitoring request. - */ - stopMonitoring(callback: Function): void; - /** - * Get the current monitoring traced data. Child processes typically are caching trace data - * and only rarely flush and send trace data back to the main process. That is because it may - * be an expensive operation to send the trace data over IPC, and we would like to avoid much - * runtime overhead of tracing. So, to end tracing, we must asynchronously ask all child - * processes to flush any pending trace data. - * @param callback Called once all child processes have acked to the captureMonitoringSnapshot request. - */ - captureMonitoringSnapshot(resultFilePath: string, callback: - /** - * @param filePath A file that contains the traced data - * @returns {} - */ - (filePath: string) => void - ): void; - /** - * Get the maximum across processes of trace buffer percent full state. - * @param callback Called when the TraceBufferUsage value is determined. - */ - getTraceBufferUsage(callback: Function): void; - /** - * @param callback Called every time the given event occurs on any process. - */ - setWatchEvent(categoryName: string, eventName: string, callback: Function): void; - /** - * Cancel the watch event. If tracing is enabled, this may race with the watch event callback. - */ - cancelWatchEvent(): void; - DEFAULT_OPTIONS: number; - ENABLE_SYSTRACE: number; - ENABLE_SAMPLING: number; - RECORD_CONTINUOUSLY: number; - } - - interface Dialog { - /** - * @param callback If supplied, the API call will be asynchronous. - * @returns On success, returns an array of file paths chosen by the user, - * otherwise returns undefined. - */ - showOpenDialog: typeof GitHubElectron.Dialog.showOpenDialog; - /** - * @param callback If supplied, the API call will be asynchronous. - * @returns On success, returns the path of file chosen by the user, otherwise - * returns undefined. - */ - showSaveDialog: typeof GitHubElectron.Dialog.showSaveDialog; - /** - * Shows a message box. It will block until the message box is closed. It returns . - * @param callback If supplied, the API call will be asynchronous. - * @returns The index of the clicked button. - */ - showMessageBox: typeof GitHubElectron.Dialog.showMessageBox; - - /** - * Runs a modal dialog that shows an error message. This API can be called safely - * before the ready event of app module emits, it is usually used to report errors - * in early stage of startup. - */ - showErrorBox(title: string, content: string): void; - } - - interface GlobalShortcut { - /** - * Registers a global shortcut of accelerator. - * @param accelerator Represents a keyboard shortcut. It can contain modifiers - * and key codes, combined by the "+" character. - * @param callback Called when the registered shortcut is pressed by the user. - * @returns {} - */ - register(accelerator: string, callback: Function): void; - /** - * @param accelerator Represents a keyboard shortcut. It can contain modifiers - * and key codes, combined by the "+" character. - * @returns Whether the accelerator is registered. - */ - isRegistered(accelerator: string): boolean; - /** - * Unregisters the global shortcut of keycode. - * @param accelerator Represents a keyboard shortcut. It can contain modifiers - * and key codes, combined by the "+" character. - */ - unregister(accelerator: string): void; - /** - * Unregisters all the global shortcuts. - */ - unregisterAll(): void; - } - - class RequestFileJob { - /** - * Create a request job which would query a file of path and set corresponding mime types. - */ - constructor(path: string); - } - - class RequestStringJob { - /** - * Create a request job which sends a string as response. - */ - constructor(options?: { - /** - * Default is "text/plain". - */ - mimeType?: string; - /** - * Default is "UTF-8". - */ - charset?: string; - data?: string; - }); - } - - class RequestBufferJob { - /** - * Create a request job which accepts a buffer and sends a string as response. - */ - constructor(options?: { - /** - * Default is "application/octet-stream". - */ - mimeType?: string; - /** - * Default is "UTF-8". - */ - encoding?: string; - data?: Buffer; - }); - } - - interface Protocol { - registerProtocol(scheme: string, handler: (request: any) => void): void; - unregisterProtocol(scheme: string): void; - isHandledProtocol(scheme: string): boolean; - interceptProtocol(scheme: string, handler: (request: any) => void): void; - uninterceptProtocol(scheme: string): void; - RequestFileJob: typeof RequestFileJob; - RequestStringJob: typeof RequestStringJob; - RequestBufferJob: typeof RequestBufferJob; - } - - interface Electron { - app: GitHubElectron.App; - autoUpdater: GitHubElectron.AutoUpdater; - BrowserWindow: typeof GitHubElectron.BrowserWindow; - contentTracing: GitHubElectron.ContentTracing; - dialog: GitHubElectron.Dialog; - globalShortcut: GitHubElectron.GlobalShortcut; - ipcMain: NodeJS.EventEmitter; - Menu: typeof GitHubElectron.Menu; - MenuItem: typeof GitHubElectron.MenuItem; - powerMonitor: NodeJS.EventEmitter; - protocol: GitHubElectron.Protocol; - Tray: typeof GitHubElectron.Tray; - } -} - -declare module 'electron' { - var electron: GitHubElectron.Electron; - export = electron; -} - -interface NodeRequireFunction { - (id: 'electron'): GitHubElectron.Electron; -} diff --git a/github-electron/github-electron-renderer-tests.ts b/github-electron/github-electron-renderer-tests.ts index 88fa4fcd5..cf610718c 100644 --- a/github-electron/github-electron-renderer-tests.ts +++ b/github-electron/github-electron-renderer-tests.ts @@ -1,4 +1,4 @@ -/// +/// import { ipcRenderer, remote, diff --git a/github-electron/github-electron-renderer.d.ts b/github-electron/github-electron-renderer.d.ts deleted file mode 100644 index 7cfdca5a0..000000000 --- a/github-electron/github-electron-renderer.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -// Type definitions for the Electron 0.25.2 renderer process (web page) -// Project: http://electron.atom.io/ -// Definitions by: jedmao -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module GitHubElectron { - export class InProcess implements NodeJS.EventEmitter { - addListener(event: string, listener: Function): InProcess; - on(event: string, listener: Function): InProcess; - once(event: string, listener: Function): InProcess; - removeListener(event: string, listener: Function): InProcess; - removeAllListeners(event?: string): InProcess; - setMaxListeners(n: number): void; - listeners(event: string): Function[]; - emit(event: string, ...args: any[]): boolean; - /** - * Send ...args to the renderer via channel in asynchronous message, the main - * process can handle it by listening to the channel event of ipc module. - */ - send(channel: string, ...args: any[]): void; - /** - * Send ...args to the renderer via channel in synchronous message, and returns - * the result sent from main process. The main process can handle it by listening - * to the channel event of ipc module, and returns by setting event.returnValue. - * Note: Usually developers should never use this API, since sending synchronous - * message would block the whole renderer process. - * @returns The result sent from the main process. - */ - sendSync(channel: string, ...args: any[]): string; - /** - * Like ipc.send but the message will be sent to the host page instead of the main process. - * This is mainly used by the page in to communicate with host page. - */ - sendToHost(channel: string, ...args: any[]): void; - } - - interface Remote { - /** - * @returns The object returned by require(module) in the main process. - */ - require(module: string): any; - /** - * @returns The BrowserWindow object which this web page belongs to. - */ - getCurrentWindow(): BrowserWindow - /** - * @returns The global variable of name (e.g. global[name]) in the main process. - */ - getGlobal(name: string): any; - /** - * Returns the process object in the main process. This is the same as - * remote.getGlobal('process'), but gets cached. - */ - process: any; - } - - interface WebFrame { - /** - * Changes the zoom factor to the specified factor, zoom factor is - * zoom percent / 100, so 300% = 3.0. - */ - setZoomFactor(factor: number): void; - /** - * @returns The current zoom factor. - */ - getZoomFactor(): number; - /** - * Changes the zoom level to the specified level, 0 is "original size", and each - * increment above or below represents zooming 20% larger or smaller to default - * limits of 300% and 50% of original size, respectively. - */ - setZoomLevel(level: number): void; - /** - * @returns The current zoom level. - */ - getZoomLevel(): number; - /** - * Sets a provider for spell checking in input fields and text areas. - */ - setSpellCheckProvider(language: string, autoCorrectWord: boolean, provider: { - /** - * @returns Whether the word passed is correctly spelled. - */ - spellCheck: (text: string) => boolean; - }): void; - /** - * Sets the scheme as secure scheme. Secure schemes do not trigger mixed content - * warnings. For example, https and data are secure schemes because they cannot be - * corrupted by active network attackers. - */ - registerURLSchemeAsSecure(scheme: string): void; - } - - export interface Electron { - remote: GitHubElectron.Remote; - ipcRenderer: GitHubElectron.InProcess; - webFrame: GitHubElectron.WebFrame; - } -} - -declare module 'electron' { - var electron: GitHubElectron.Electron; - export = electron; -} - -interface NodeRequireFunction { - (id: 'electron'): GitHubElectron.Electron; -} diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 05a4a6571..10c3a43f2 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1405,12 +1405,306 @@ declare module GitHubElectron { beep(): void; } + // Type definitions for renderer process + + export class IpcRenderer implements NodeJS.EventEmitter { + addListener(event: string, listener: Function): IpcRenderer; + on(event: string, listener: Function): IpcRenderer; + once(event: string, listener: Function): IpcRenderer; + removeListener(event: string, listener: Function): IpcRenderer; + removeAllListeners(event?: string): IpcRenderer; + setMaxListeners(n: number): void; + listeners(event: string): Function[]; + emit(event: string, ...args: any[]): boolean; + /** + * Send ...args to the renderer via channel in asynchronous message, the main + * process can handle it by listening to the channel event of ipc module. + */ + send(channel: string, ...args: any[]): void; + /** + * Send ...args to the renderer via channel in synchronous message, and returns + * the result sent from main process. The main process can handle it by listening + * to the channel event of ipc module, and returns by setting event.returnValue. + * Note: Usually developers should never use this API, since sending synchronous + * message would block the whole renderer process. + * @returns The result sent from the main process. + */ + sendSync(channel: string, ...args: any[]): string; + /** + * Like ipc.send but the message will be sent to the host page instead of the main process. + * This is mainly used by the page in to communicate with host page. + */ + sendToHost(channel: string, ...args: any[]): void; + } + + interface Remote { + /** + * @returns The object returned by require(module) in the main process. + */ + require(module: string): any; + /** + * @returns The BrowserWindow object which this web page belongs to. + */ + getCurrentWindow(): BrowserWindow + /** + * @returns The global variable of name (e.g. global[name]) in the main process. + */ + getGlobal(name: string): any; + /** + * Returns the process object in the main process. This is the same as + * remote.getGlobal('process'), but gets cached. + */ + process: any; + } + + interface WebFrame { + /** + * Changes the zoom factor to the specified factor, zoom factor is + * zoom percent / 100, so 300% = 3.0. + */ + setZoomFactor(factor: number): void; + /** + * @returns The current zoom factor. + */ + getZoomFactor(): number; + /** + * Changes the zoom level to the specified level, 0 is "original size", and each + * increment above or below represents zooming 20% larger or smaller to default + * limits of 300% and 50% of original size, respectively. + */ + setZoomLevel(level: number): void; + /** + * @returns The current zoom level. + */ + getZoomLevel(): number; + /** + * Sets a provider for spell checking in input fields and text areas. + */ + setSpellCheckProvider(language: string, autoCorrectWord: boolean, provider: { + /** + * @returns Whether the word passed is correctly spelled. + */ + spellCheck: (text: string) => boolean; + }): void; + /** + * Sets the scheme as secure scheme. Secure schemes do not trigger mixed content + * warnings. For example, https and data are secure schemes because they cannot be + * corrupted by active network attackers. + */ + registerURLSchemeAsSecure(scheme: string): void; + } + + // Type definitions for main process + + interface ContentTracing { + /** + * Get a set of category groups. The category groups can change as new code paths are reached. + * @param callback Called once all child processes have acked to the getCategories request. + */ + getCategories(callback: (categoryGroups: any[]) => void): void; + /** + * Start recording on all processes. Recording begins immediately locally, and asynchronously + * on child processes as soon as they receive the EnableRecording request. + * @param categoryFilter A filter to control what category groups should be traced. + * A filter can have an optional "-" prefix to exclude category groups that contain + * a matching category. Having both included and excluded category patterns in the + * same list would not be supported. + * @param options controls what kind of tracing is enabled, it could be a OR-ed + * combination of tracing.DEFAULT_OPTIONS, tracing.ENABLE_SYSTRACE, tracing.ENABLE_SAMPLING + * and tracing.RECORD_CONTINUOUSLY. + * @param callback Called once all child processes have acked to the startRecording request. + */ + startRecording(categoryFilter: string, options: number, callback: Function): void; + /** + * Stop recording on all processes. Child processes typically are caching trace data and + * only rarely flush and send trace data back to the main process. That is because it may + * be an expensive operation to send the trace data over IPC, and we would like to avoid + * much runtime overhead of tracing. So, to end tracing, we must asynchronously ask all + * child processes to flush any pending trace data. + * @param resultFilePath Trace data will be written into this file if it is not empty, + * or into a temporary file. + * @param callback Called once all child processes have acked to the stopRecording request. + */ + stopRecording(resultFilePath: string, callback: + /** + * @param filePath A file that contains the traced data. + */ + (filePath: string) => void + ): void; + /** + * Start monitoring on all processes. Monitoring begins immediately locally, and asynchronously + * on child processes as soon as they receive the startMonitoring request. + * @param callback Called once all child processes have acked to the startMonitoring request. + */ + startMonitoring(categoryFilter: string, options: number, callback: Function): void; + /** + * Stop monitoring on all processes. + * @param callback Called once all child processes have acked to the stopMonitoring request. + */ + stopMonitoring(callback: Function): void; + /** + * Get the current monitoring traced data. Child processes typically are caching trace data + * and only rarely flush and send trace data back to the main process. That is because it may + * be an expensive operation to send the trace data over IPC, and we would like to avoid much + * runtime overhead of tracing. So, to end tracing, we must asynchronously ask all child + * processes to flush any pending trace data. + * @param callback Called once all child processes have acked to the captureMonitoringSnapshot request. + */ + captureMonitoringSnapshot(resultFilePath: string, callback: + /** + * @param filePath A file that contains the traced data + * @returns {} + */ + (filePath: string) => void + ): void; + /** + * Get the maximum across processes of trace buffer percent full state. + * @param callback Called when the TraceBufferUsage value is determined. + */ + getTraceBufferUsage(callback: Function): void; + /** + * @param callback Called every time the given event occurs on any process. + */ + setWatchEvent(categoryName: string, eventName: string, callback: Function): void; + /** + * Cancel the watch event. If tracing is enabled, this may race with the watch event callback. + */ + cancelWatchEvent(): void; + DEFAULT_OPTIONS: number; + ENABLE_SYSTRACE: number; + ENABLE_SAMPLING: number; + RECORD_CONTINUOUSLY: number; + } + + interface Dialog { + /** + * @param callback If supplied, the API call will be asynchronous. + * @returns On success, returns an array of file paths chosen by the user, + * otherwise returns undefined. + */ + showOpenDialog: typeof GitHubElectron.Dialog.showOpenDialog; + /** + * @param callback If supplied, the API call will be asynchronous. + * @returns On success, returns the path of file chosen by the user, otherwise + * returns undefined. + */ + showSaveDialog: typeof GitHubElectron.Dialog.showSaveDialog; + /** + * Shows a message box. It will block until the message box is closed. It returns . + * @param callback If supplied, the API call will be asynchronous. + * @returns The index of the clicked button. + */ + showMessageBox: typeof GitHubElectron.Dialog.showMessageBox; + + /** + * Runs a modal dialog that shows an error message. This API can be called safely + * before the ready event of app module emits, it is usually used to report errors + * in early stage of startup. + */ + showErrorBox(title: string, content: string): void; + } + + interface GlobalShortcut { + /** + * Registers a global shortcut of accelerator. + * @param accelerator Represents a keyboard shortcut. It can contain modifiers + * and key codes, combined by the "+" character. + * @param callback Called when the registered shortcut is pressed by the user. + * @returns {} + */ + register(accelerator: string, callback: Function): void; + /** + * @param accelerator Represents a keyboard shortcut. It can contain modifiers + * and key codes, combined by the "+" character. + * @returns Whether the accelerator is registered. + */ + isRegistered(accelerator: string): boolean; + /** + * Unregisters the global shortcut of keycode. + * @param accelerator Represents a keyboard shortcut. It can contain modifiers + * and key codes, combined by the "+" character. + */ + unregister(accelerator: string): void; + /** + * Unregisters all the global shortcuts. + */ + unregisterAll(): void; + } + + class RequestFileJob { + /** + * Create a request job which would query a file of path and set corresponding mime types. + */ + constructor(path: string); + } + + class RequestStringJob { + /** + * Create a request job which sends a string as response. + */ + constructor(options?: { + /** + * Default is "text/plain". + */ + mimeType?: string; + /** + * Default is "UTF-8". + */ + charset?: string; + data?: string; + }); + } + + class RequestBufferJob { + /** + * Create a request job which accepts a buffer and sends a string as response. + */ + constructor(options?: { + /** + * Default is "application/octet-stream". + */ + mimeType?: string; + /** + * Default is "UTF-8". + */ + encoding?: string; + data?: Buffer; + }); + } + + interface Protocol { + registerProtocol(scheme: string, handler: (request: any) => void): void; + unregisterProtocol(scheme: string): void; + isHandledProtocol(scheme: string): boolean; + interceptProtocol(scheme: string, handler: (request: any) => void): void; + uninterceptProtocol(scheme: string): void; + RequestFileJob: typeof RequestFileJob; + RequestStringJob: typeof RequestStringJob; + RequestBufferJob: typeof RequestBufferJob; + } + + interface Electron { clipboard: GitHubElectron.Clipboard; crashReporter: GitHubElectron.CrashReporter; nativeImage: GitHubElectron.NativeImage; screen: GitHubElectron.Screen; shell: GitHubElectron.Shell; + remote: GitHubElectron.Remote; + ipcRenderer: GitHubElectron.IpcRenderer; + webFrame: GitHubElectron.WebFrame; + app: GitHubElectron.App; + autoUpdater: GitHubElectron.AutoUpdater; + BrowserWindow: typeof GitHubElectron.BrowserWindow; + contentTracing: GitHubElectron.ContentTracing; + dialog: GitHubElectron.Dialog; + globalShortcut: GitHubElectron.GlobalShortcut; + ipcMain: NodeJS.EventEmitter; + Menu: typeof GitHubElectron.Menu; + MenuItem: typeof GitHubElectron.MenuItem; + powerMonitor: NodeJS.EventEmitter; + protocol: GitHubElectron.Protocol; + Tray: typeof GitHubElectron.Tray; } } @@ -1429,10 +1723,11 @@ interface File { path: string; } +declare module 'electron' { + var electron: GitHubElectron.Electron; + export = electron; +} + interface NodeRequireFunction { - (id: 'clipboard'): GitHubElectron.Clipboard - (id: 'crash-reporter'): GitHubElectron.CrashReporter - (id: 'native-image'): typeof GitHubElectron.NativeImage - (id: 'screen'): GitHubElectron.Screen - (id: 'shell'): GitHubElectron.Shell + (id: 'electron'): GitHubElectron.Electron; } From 1386ebca373368ddc149a389fe1973ceefe5c625 Mon Sep 17 00:00:00 2001 From: Igor Sidorov Date: Wed, 9 Dec 2015 18:52:15 +0300 Subject: [PATCH 125/134] mdDialog.hide should return Promise instead of void --- angular-material/angular-material-0.8.3.d.ts | 2 +- angular-material/angular-material-0.9.0.d.ts | 2 +- angular-material/angular-material.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/angular-material/angular-material-0.8.3.d.ts b/angular-material/angular-material-0.8.3.d.ts index 1e3eda18a..10724b812 100644 --- a/angular-material/angular-material-0.8.3.d.ts +++ b/angular-material/angular-material-0.8.3.d.ts @@ -59,7 +59,7 @@ declare module angular.material { show(dialog: MDDialogOptions|MDPresetDialog): angular.IPromise; confirm(): MDConfirmDialog; alert(): MDAlertDialog; - hide(response?: any): void; + hide(response?: any): angular.IPromise; cancel(response?: any): void; } diff --git a/angular-material/angular-material-0.9.0.d.ts b/angular-material/angular-material-0.9.0.d.ts index 1383b0beb..96134f114 100644 --- a/angular-material/angular-material-0.9.0.d.ts +++ b/angular-material/angular-material-0.9.0.d.ts @@ -64,7 +64,7 @@ declare module angular.material { show(dialog: MDDialogOptions|MDAlertDialog|MDConfirmDialog): angular.IPromise; confirm(): MDConfirmDialog; alert(): MDAlertDialog; - hide(response?: any): void; + hide(response?: any): angular.IPromise; cancel(response?: any): void; } diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 43e0b9f53..7d29e7492 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -83,7 +83,7 @@ declare module angular.material { show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise; confirm(): IConfirmDialog; alert(): IAlertDialog; - hide(response?: any): void; + hide(response?: any): angular.IPromise; cancel(response?: any): void; } From 8f6135b6a0b9484b7fb4e43d8549ff868c8043c1 Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 10 Dec 2015 00:52:07 +0900 Subject: [PATCH 126/134] github-electron: Fix min-width style properties of BrowserWindowOptions to minWidth style They were renamed at Electron v0.35 and previous names were deprecated. https://github.com/atom/electron/blob/master/docs/api/browser-window.md#new-browserwindowoptions --- github-electron/github-electron-main-tests.ts | 2 +- github-electron/github-electron.d.ts | 56 +++++++++---------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index 84f1ca89c..74a307710 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -169,7 +169,7 @@ app.on('ready', () => { window = new BrowserWindow({ width: 800, height: 600, - 'title-bar-style': 'hidden-inset', + titleBarStyle: 'hidden-inset', }); window.loadURL('https://github.com'); }); diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 10c3a43f2..e9d5aa099 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -451,50 +451,50 @@ declare module GitHubElectron { // http://electron.atom.io/docs/v0.29.0/api/browser-window/ interface BrowserWindowOptions extends Rectangle { show?: boolean; - 'use-content-size'?: boolean; + useContentSize?: boolean; center?: boolean; - 'min-width'?: number; - 'min-height'?: number; - 'max-width'?: number; - 'max-height'?: number; + minWidth?: number; + minHeight?: number; + maxWidth?: number; + maxHeight?: number; resizable?: boolean; - 'always-on-top'?: boolean; + alwaysOnTop?: boolean; fullscreen?: boolean; - 'skip-taskbar'?: boolean; - 'zoom-factor'?: number; + skipTaskbar?: boolean; + zoomFactor?: number; kiosk?: boolean; title?: string; icon?: NativeImage|string; frame?: boolean; - 'node-integration'?: boolean; - 'accept-first-mouse'?: boolean; - 'disable-auto-hide-cursor'?: boolean; - 'auto-hide-menu-bar'?: boolean; - 'enable-larger-than-screen'?: boolean; - 'dark-theme'?: boolean; + nodeIntegration?: boolean; + acceptFirstMouse?: boolean; + disableAutoHideCursor?: boolean; + autoHideMenuBar?: boolean; + enableLargerThanScreen?: boolean; + darkTheme?: boolean; preload?: string; transparent?: boolean; type?: string; - 'standard-window'?: boolean; - 'web-preferences'?: any; // Object + standardWindow?: boolean; + webPreferences?: any; // Object javascript?: boolean; - 'web-security'?: boolean; + webSecurity?: boolean; images?: boolean; java?: boolean; - 'text-areas-are-resizable'?: boolean; + textAreasAreResizable?: boolean; webgl?: boolean; webaudio?: boolean; plugins?: boolean; - 'extra-plugin-dirs'?: string[]; - 'experimental-features'?: boolean; - 'experimental-canvas-features'?: boolean; - 'subpixel-font-scaling'?: boolean; - 'overlay-scrollbars'?: boolean; - 'overlay-fullscreen-video'?: boolean; - 'shared-worker'?: boolean; - 'direct-write'?: boolean; - 'page-visibility'?: boolean; - 'title-bar-style'?: string; + extraPluginDirs?: string[]; + experimentalFeatures?: boolean; + experimentalCanvasFeatures?: boolean; + subpixelFontScaling?: boolean; + overlayScrollbars?: boolean; + overlayFullscreenVideo?: boolean; + sharedWorker?: boolean; + directWrite?: boolean; + pageVisibility?: boolean; + titleBarStyle?: string; } interface Rectangle { From 9fbacecc6ad974a16f9867e9662da1c73a1bad61 Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 10 Dec 2015 00:59:39 +0900 Subject: [PATCH 127/134] github-electron: Define type of webPreferences property of BrowserWindowOptions https://github.com/atom/electron/blob/master/docs/api/browser-window.md#new-browserwindowoptions --- github-electron/github-electron.d.ts | 37 +++++++++++++++++----------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index e9d5aa099..2d2363ccc 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -447,6 +447,28 @@ declare module GitHubElectron { isVisibleOnAllWorkspaces(): boolean; } + interface WebPreferences { + nodeIntegration?: boolean; + preload?: string; + partition: string; + zoomFactor: number; + javascript: boolean; + webSecurity: boolean; + allowDisplayingInsecureContent: boolean; + allowRunningInsecureContent: boolean; + images: boolean; + textAreasAreResizable: boolean; + webgl?: boolean; + webaudio?: boolean; + plugins?: boolean; + experimentalFeatures?: boolean; + experimentalCanvasFeatures?: boolean; + overlayScrollbars?: boolean; + sharedWorker?: boolean; + directWrite?: boolean; + pageVisibility?: boolean; + } + // Includes all options BrowserWindow can take as of this writing // http://electron.atom.io/docs/v0.29.0/api/browser-window/ interface BrowserWindowOptions extends Rectangle { @@ -466,7 +488,6 @@ declare module GitHubElectron { title?: string; icon?: NativeImage|string; frame?: boolean; - nodeIntegration?: boolean; acceptFirstMouse?: boolean; disableAutoHideCursor?: boolean; autoHideMenuBar?: boolean; @@ -476,24 +497,12 @@ declare module GitHubElectron { transparent?: boolean; type?: string; standardWindow?: boolean; - webPreferences?: any; // Object - javascript?: boolean; - webSecurity?: boolean; - images?: boolean; + webPreferences?: WebPreferences; java?: boolean; textAreasAreResizable?: boolean; - webgl?: boolean; - webaudio?: boolean; - plugins?: boolean; extraPluginDirs?: string[]; - experimentalFeatures?: boolean; - experimentalCanvasFeatures?: boolean; subpixelFontScaling?: boolean; - overlayScrollbars?: boolean; overlayFullscreenVideo?: boolean; - sharedWorker?: boolean; - directWrite?: boolean; - pageVisibility?: boolean; titleBarStyle?: string; } From 41b42c1609ce6f0b48af2952de352d0525e828e7 Mon Sep 17 00:00:00 2001 From: James O'Cull Date: Wed, 9 Dec 2015 17:08:36 -0500 Subject: [PATCH 128/134] QueryInterface should have `sequelize` property --- sequelize/sequelize.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sequelize/sequelize.d.ts b/sequelize/sequelize.d.ts index 46a0ba41a..3f1e2c86f 100644 --- a/sequelize/sequelize.d.ts +++ b/sequelize/sequelize.d.ts @@ -3949,6 +3949,11 @@ declare module "sequelize" { * We don't have a definition for the QueryGenerator, because I doubt it is commonly in use separately. */ QueryGenerator: any; + + /** + * Returns the current sequelize instance. + */ + sequelize: Sequelize; /** * Queries the schema (table list). From 47bf640e91b6ef48d7ad56a34fe9c91f84b81799 Mon Sep 17 00:00:00 2001 From: Quentin Jones Date: Wed, 9 Dec 2015 19:22:17 -0600 Subject: [PATCH 129/134] Added a couple options missing from interface --- bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts index fb0b1b389..bd8a3ff54 100644 --- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts +++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts @@ -54,6 +54,8 @@ declare module BootstrapV3DatetimePicker { showTodayButton?: boolean; viewMode?: string; inline?: boolean; + toolbarPlacement?: string; + showClear?: boolean; } interface Datetimepicker { From 9cb7452abb970f4df7548b97587187b3b5b05123 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Thu, 10 Dec 2015 06:20:45 +0500 Subject: [PATCH 130/134] lodash: signatures of _.isBoolean have been changed --- lodash/lodash-tests.ts | 41 +++++++++++++++++++++++++++-------------- lodash/lodash.d.ts | 10 +++++++++- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index c409e2621..e45f03a09 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -5337,20 +5337,33 @@ result = _({}).isArray(); } // _.isBoolean -result = _.isBoolean(any); -result = _(1).isBoolean(); -result = _([]).isBoolean(); -result = _({}).isBoolean(); -{ - let value: number[]|boolean = [1, 3, 5]; - if (_.isBoolean(value)) { - let b: boolean = value; - // compile error - // let length: number = value.length; - } else { - let length: number = value.length; - // compile error - // let b: boolean = value; +module TestIsBoolean { + { + let value: number|boolean; + + if (_.isBoolean(value)) { + let result: boolean = value; + } + else { + let result: number = value; + } + } + + { + let result: boolean; + + result = _.isBoolean(any); + result = _(1).isBoolean(); + result = _([]).isBoolean(); + result = _({}).isBoolean(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().isBoolean(); + result = _([]).chain().isBoolean(); + result = _({}).chain().isBoolean(); } } diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 253107c7f..04abeb490 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -9212,9 +9212,10 @@ declare module _ { interface LoDashStatic { /** * Checks if value is classified as a boolean primitive or object. + * * @param value The value to check. * @return Returns true if value is correctly classified, else false. - **/ + */ isBoolean(value?: any): value is boolean; } @@ -9225,6 +9226,13 @@ declare module _ { isBoolean(): boolean; } + interface LoDashExplicitWrapperBase { + /** + * @see _.isBoolean + */ + isBoolean(): LoDashExplicitWrapper; + } + //_.isDate interface LoDashStatic { /** From 0ef797c1356c5ed73483e164213f4d938fbbc6fd Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Wed, 9 Dec 2015 20:35:57 -0600 Subject: [PATCH 131/134] [node] export Stream as class, not interface require('stream').Stream in Node.js is a constructor. --- node/node.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node.d.ts b/node/node.d.ts index 017ca8e6b..d1650174c 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1675,7 +1675,7 @@ declare module "crypto" { declare module "stream" { import * as events from "events"; - export interface Stream extends events.EventEmitter { + export class Stream extends events.EventEmitter { pipe(destination: T, options?: { end?: boolean; }): T; } From 249633b2150e89025ae836d52b32583ec8be75ac Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 10 Dec 2015 21:38:55 +0900 Subject: [PATCH 132/134] fix chrome.d.ts type header --- chrome/chrome.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index 7db591be2..77d2898fd 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -1,6 +1,6 @@ // Type definitions for Chrome extension development // Project: http://developer.chrome.com/extensions/ -// Definitions by: Matthew Kimber , otiai10 , couven92 +// Definitions by: Matthew Kimber , otiai10 , couven92 // Definitions: https://github.com/borisyankov/DefinitelyTyped /// From a0d89370306da9dd4643242b4b4c0ba9934511c4 Mon Sep 17 00:00:00 2001 From: Graham Mendick Date: Thu, 10 Dec 2015 13:44:18 +0000 Subject: [PATCH 133/134] Updated typings and tests for Navigation 1.2.0 --- navigation/navigation-tests.ts | 21 ++++-- navigation/navigation.d.ts | 127 +++++++++++++++++++++++++++++++-- 2 files changed, 138 insertions(+), 10 deletions(-) diff --git a/navigation/navigation-tests.ts b/navigation/navigation-tests.ts index 758e0e53f..d3676e82e 100644 --- a/navigation/navigation-tests.ts +++ b/navigation/navigation-tests.ts @@ -38,8 +38,8 @@ module NavigationTests { // Configuration Navigation.StateInfoConfig.build([ - { key: 'home', initial: 'page', states: [ - { key: 'page', route: '' } + { key: 'home', initial: 'page', help: 'home.htm', states: [ + { key: 'page', route: '', help: 'page.htm' } ]}, { key: 'person', initial: 'list', states: [ { key: 'list', route: ['people/{page}', 'people/{page}/sort/{sort}'], transitions: [ @@ -97,24 +97,28 @@ module NavigationTests { // Navigation Navigation.start('home'); Navigation.StateController.navigate('person'); + Navigation.StateController.navigate('person', null, Navigation.HistoryAction.Add); Navigation.StateController.refresh(); - Navigation.StateController.refresh({ page: 2 }); + Navigation.StateController.refresh({ page: 3 }); + Navigation.StateController.refresh({ page: 2 }, Navigation.HistoryAction.Replace); Navigation.StateController.navigate('select', { id: 10 }); var canGoBack: boolean = Navigation.StateController.canNavigateBack(1); Navigation.StateController.navigateBack(1); + Navigation.StateController.clearStateContext(); // Navigation Link var link = Navigation.StateController.getNavigationLink('person'); link = Navigation.StateController.getRefreshLink(); link = Navigation.StateController.getRefreshLink({ page: 2 }); + Navigation.StateController.navigateLink(link); link = Navigation.StateController.getNavigationLink('select', { id: 10 }); var nextDialog = Navigation.StateController.getNextState('select').parent; person = nextDialog; - Navigation.StateController.navigateLink(link); + Navigation.StateController.navigateLink(link, false); link = Navigation.StateController.getNavigationBackLink(1); var crumb = Navigation.StateController.crumbs[0]; link = crumb.navigationLink; - Navigation.StateController.navigateLink(link, true); + Navigation.StateController.navigateLink(link, true, Navigation.HistoryAction.None); // StateContext Navigation.StateController.navigate('home'); @@ -124,10 +128,15 @@ module NavigationTests { person === Navigation.StateContext.dialog; personList === Navigation.StateContext.state; var url: string = Navigation.StateContext.url; + var title: string = Navigation.StateContext.title; var page: number = Navigation.StateContext.data.page; + Navigation.StateController.refresh({ page: 2 }); + person = Navigation.StateContext.oldDialog; + personList = Navigation.StateContext.oldState; + page = Navigation.StateContext.oldData.page; + page = Navigation.StateContext.previousData.page; // Navigation Data - Navigation.StateController.refresh({ page: 2 }); var data = Navigation.StateContext.includeCurrentData({ sort: 'name' }, ['page']); Navigation.StateController.refresh(data); Navigation.StateContext.clear('sort'); diff --git a/navigation/navigation.d.ts b/navigation/navigation.d.ts index 59af79ca2..418cec8a4 100644 --- a/navigation/navigation.d.ts +++ b/navigation/navigation.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Navigation 1.1.0 +// Type definitions for Navigation 1.2.0 // Project: http://grahammendick.github.io/navigation/ // Definitions by: Graham Mendick // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -31,6 +31,10 @@ declare module Navigation { * Gets the textual description of the dialog */ title?: string; + /** + * Gets the additional dialog attributes + */ + [extras: string]: any; } /** @@ -75,6 +79,10 @@ declare module Navigation { * preserved when navigating */ trackTypes?: boolean; + /** + * Gets the additional state attributes + */ + [extras: string]: any; } /** @@ -278,6 +286,24 @@ declare module Navigation { */ static build(dialogs: IDialog[]>[]>[]): void; } + + /** + * Determines the effect on browser history after a successful navigation + */ + enum HistoryAction { + /** + * Creates a new browser history entry + */ + Add = 0, + /** + * Changes the current browser history entry + */ + Replace = 1, + /** + * Leaves browser history unchanged + */ + None = 2, + } /** * Defines a contract a class must implement in order to manage the browser @@ -295,9 +321,17 @@ declare module Navigation { /** * Adds browser history * @param state The State navigated to - * @param url The current url + * @param url The current url */ addHistory(state: State, url: string): void; + /** + * Adds browser history + * @param state The State navigated to + * @param url The current url + * @param replace A value indicating whether to replace the current + * browser history entry + */ + addHistory(state: State, url: string, replace: boolean): void; /** * Gets the current location */ @@ -339,6 +373,14 @@ declare module Navigation { * @param url The current url */ addHistory(state: State, url: string): void; + /** + * Sets the browser Url's hash to the url + * @param state The State navigated to + * @param url The current url + * @param replace A value indicating whether to replace the current + * browser history entry + */ + addHistory(state: State, url: string, replace: boolean): void; /** * Gets the current location */ @@ -375,6 +417,14 @@ declare module Navigation { * @param url The current url */ addHistory(state: State, url: string): void; + /** + * Sets the browser Url to the url using pushState + * @param state The State navigated to + * @param url The current url + * @param replace A value indicating whether to replace the current + * browser history entry + */ + addHistory(state: State, url: string, replace: boolean): void; /** * Gets the current location */ @@ -587,6 +637,11 @@ declare module Navigation { * ReturnData should be part of the CrumbTrail */ combineCrumbTrail: boolean; + /** + * Gets or sets a value indicating whether to track PreviousData when + * navigating back or refreshing and combineCrumbTrail is false + */ + trackAllPreviousData: boolean; } /** @@ -595,6 +650,18 @@ declare module Navigation { * previous State (this is not the same as the previous Crumb) */ class StateContext { + /** + * Gets the last State displayed before the current State + */ + static oldState: State; + /** + * Gets the parent of the OldState property + */ + static oldDialog: Dialog; + /** + * Gets the NavigationData for the last displayed State + */ + static oldData: any; /** * Gets the State navigated away from to reach the current State */ @@ -603,6 +670,10 @@ declare module Navigation { * Gets the parent of the PreviousState property */ static previousDialog: Dialog; + /** + * Gets the NavigationData for the navigated away from State + */ + static previousData: any; /** * Gets the current State */ @@ -612,14 +683,17 @@ declare module Navigation { */ static dialog: Dialog; /** - * Gets the NavigationData for the current State. It can be accessed. - * Will become the data stored in a Crumb when part of a crumb trail + * Gets the NavigationData for the current State */ static data: any; /** * Gets the current Url */ static url: string; + /** + * Gets or sets the current title + */ + static title: string; /** * Combines the data with all the current NavigationData * @param The data to add to the current NavigationData @@ -660,6 +734,10 @@ declare module Navigation { * @param url The current Url */ static setStateContext(state: State, url: string): void; + /** + * Clears the Context Data + */ + static clearStateContext(): void; /** * Registers a navigate event listener * @param handler The navigate event listener @@ -694,6 +772,20 @@ declare module Navigation { * @throws A mandatory route parameter has not been supplied a value */ static navigate(action: string, toData: any): void; + /** + * Navigates to a State. Depending on the action will either navigate + * to the 'to' State of a Transition or the 'initial' State of a + * Dialog + * @param action The key of a child Transition or the key of a Dialog + * @param toData The NavigationData to be passed to the next State and + * stored in the StateContext + * @param A value determining the effect on browser history + * @throws action does not match the key of a child Transition or the + * key of a Dialog; or there is NavigationData that cannot be converted + * to a String + * @throws A mandatory route parameter has not been supplied a value + */ + static navigate(action: string, toData: any, historyAction: HistoryAction): void; /** * Gets a Url to navigate to a State. Depending on the action will * either navigate to the 'to' State of a Transition or the 'initial' @@ -733,6 +825,17 @@ declare module Navigation { * @throws A mandatory route parameter has not been supplied a value */ static navigateBack(distance: number): void; + /** + * Navigates back to the Crumb contained in the crumb trail, + * represented by the Crumbs collection, as specified by the distance. + * In the crumb trail no two crumbs can have the same State but all + * must have the same Dialog + * @param distance Starting at 1, the number of Crumb steps to go back + * @param A value determining the effect on browser history + * @throws canNavigateBack returns false for this distance + * @throws A mandatory route parameter has not been supplied a value + */ + static navigateBack(distance: number, historyAction: HistoryAction): void; /** * Gets a Url to navigate to a Crumb contained in the crumb trail, * represented by the Crumbs collection, as specified by the distance. @@ -755,6 +858,15 @@ declare module Navigation { * @throws A mandatory route parameter has not been supplied a value */ static refresh(toData: any): void; + /** + * Navigates to the current State + * @param toData The NavigationData to be passed to the current State + * and stored in the StateContext + * @param A value determining the effect on browser history + * @throws There is NavigationData that cannot be converted to a String + * @throws A mandatory route parameter has not been supplied a value + */ + static refresh(toData: any, historyAction: HistoryAction): void; /** * Gets a Url to navigate to the current State passing no * NavigationData @@ -779,6 +891,13 @@ declare module Navigation { * @param history A value indicating whether browser history was used */ static navigateLink(url: string, history: boolean): void; + /** + * Navigates to the url + * @param url The target location + * @param history A value indicating whether browser history was used + * @param A value determining the effect on browser history + */ + static navigateLink(url: string, history: boolean, historyAction: HistoryAction): void; /** * Gets the next State. Depending on the action will either return the * 'to' State of a Transition or the 'initial' State of a Dialog From 6d32913dc56b916ef69f916350ff9a04133466ed Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 10 Dec 2015 01:01:28 +0900 Subject: [PATCH 134/134] github-electron: Update header --- github-electron/github-electron.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 2d2363ccc..5bd8a4489 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1,7 +1,7 @@ -// Type definitions for Electron 0.25.2 (shared between main and rederer processes) +// Type definitions for Electron v0.35.0 // Project: http://electron.atom.io/ -// Definitions by: jedmao -// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Definitions by: jedmao , rhysd +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped ///